From: Olivier Houchard Date: Tue, 16 Oct 2018 16:35:01 +0000 (+0200) Subject: MINOR: server: Use memcpy() instead of strncpy(). X-Git-Tag: v1.9-dev4~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17f8b90736d811ac9a04af198a3aee34e9935cec;p=thirdparty%2Fhaproxy.git MINOR: server: Use memcpy() instead of strncpy(). Use memcpy instead of strncpy, strncpy buys us nothing, and gcc is being annoying. --- diff --git a/src/server.c b/src/server.c index c817c39169..9a0392084f 100644 --- a/src/server.c +++ b/src/server.c @@ -3170,7 +3170,7 @@ void apply_server_state(void) globalfilepathlen = 0; goto globalfileerror; } - strncpy(globalfilepath, global.server_state_base, len); + memcpy(globalfilepath, global.server_state_base, len); globalfilepath[globalfilepathlen] = 0; /* append a slash if needed */ @@ -3239,7 +3239,7 @@ void apply_server_state(void) localfilepathlen = 0; goto localfileerror; } - strncpy(localfilepath, global.server_state_base, len); + memcpy(localfilepath, global.server_state_base, len); localfilepath[localfilepathlen] = 0; /* append a slash if needed */