Bugfix/win32 build warnings (#936)

* Changed win32 port of localtime to use secure OS API functions when compiled with MSVC

* Changed all the sprintf to use snprintf instead in BSC tests to ensure null string endings.
This commit is contained in:
Steve Karg
2025-03-03 10:32:28 -06:00
committed by GitHub
parent b0a26cf2cd
commit 7e725ce028
21 changed files with 317 additions and 275 deletions
+4 -5
View File
@@ -8143,8 +8143,8 @@ static void test_simple(void)
memset(&srv_ctx, 0, sizeof(srv_ctx));
srv_ctx.ev = -1;
srv_ctx.h = BSC_WEBSOCKET_INVALID_HANDLE;
sprintf(
url, "wss://%s:%d", BACNET_WEBSOCKET_SERVER_ADDR,
snprintf(
url, sizeof(url), "wss://%s:%d", BACNET_WEBSOCKET_SERVER_ADDR,
BACNET_WEBSOCKET_SERVER_PORT);
ret = bws_srv_start(
@@ -8211,10 +8211,9 @@ static void test_onoff(void)
memset(&srv_ctx, 0, sizeof(srv_ctx));
srv_ctx.ev = -1;
srv_ctx.h = BSC_WEBSOCKET_INVALID_HANDLE;
sprintf(
url, "wss://%s:%d", BACNET_WEBSOCKET_SERVER_ADDR,
snprintf(
url, sizeof(url), "wss://%s:%d", BACNET_WEBSOCKET_SERVER_ADDR,
BACNET_WEBSOCKET_SERVER_PORT);
ret = bws_srv_start(
BSC_WEBSOCKET_HUB_PROTOCOL, BACNET_WEBSOCKET_SERVER_PORT, NULL, ca_cert,
sizeof(ca_cert), server_cert, sizeof(server_cert), server_key,