Skip to content

Commit

Permalink
fix strcpy warning on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gafferongames committed Dec 26, 2023
1 parent b0e896e commit e15f109
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,8 @@ struct TestObject
for ( int i = 0; i < (int) sizeof( data.bytes ); ++i )
data.bytes[i] = rand() % 255;

strcpy( data.string, "hello world!" );
memset( data.string, 0, sizeof(data.string) );
strncpy( data.string, "hello world!", sizeof(data.string) - 1 );
}

template <typename Stream> bool Serialize( Stream & stream )
Expand Down

0 comments on commit e15f109

Please sign in to comment.