fix the implementation of gmtime_r in IPv6 demo (#1066)

This commit is contained in:
Tony Josi 2023-08-09 19:19:04 +05:30 committed by GitHub
parent 9a9e6236a1
commit eefb87aa0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -869,16 +869,12 @@ static void prvServerWorkTask( void * pvArgument )
struct tm * gmtime_r( const time_t * pxTime,
struct tm * tmStruct )
{
struct tm tm;
memcpy( &( tm ), gmtime( pxTime ), sizeof( tm ) );
if( tmStruct != NULL )
{
memcpy( tmStruct, &( tm ), sizeof tm );
memcpy( tmStruct, gmtime( pxTime ), sizeof( struct tm ) );
}
return &( tm );
return tmStruct;
}
/*-----------------------------------------------------------*/