Skip to content

Commit eefb87a

Browse files
fix the implementation of gmtime_r in IPv6 demo (FreeRTOS#1066)
1 parent 9a9e623 commit eefb87a

File tree

1 file changed

+2
-6
lines changed
  • FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo

1 file changed

+2
-6
lines changed

FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo/main.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -869,16 +869,12 @@ static void prvServerWorkTask( void * pvArgument )
869869
struct tm * gmtime_r( const time_t * pxTime,
870870
struct tm * tmStruct )
871871
{
872-
struct tm tm;
873-
874-
memcpy( &( tm ), gmtime( pxTime ), sizeof( tm ) );
875-
876872
if( tmStruct != NULL )
877873
{
878-
memcpy( tmStruct, &( tm ), sizeof tm );
874+
memcpy( tmStruct, gmtime( pxTime ), sizeof( struct tm ) );
879875
}
880876

881-
return &( tm );
877+
return tmStruct;
882878
}
883879
/*-----------------------------------------------------------*/
884880

0 commit comments

Comments
 (0)