From e15f1099ec80e08ddb7e9cf730392a99d741d0ba Mon Sep 17 00:00:00 2001 From: Glenn Fiedler Date: Tue, 26 Dec 2023 12:25:06 -0500 Subject: [PATCH] fix strcpy warning on windows --- serialize.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serialize.h b/serialize.h index 4972651..3647816 100644 --- a/serialize.h +++ b/serialize.h @@ -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 bool Serialize( Stream & stream )