MINOR: server: Use memcpy() instead of strncpy().
Use memcpy instead of strncpy, strncpy buys us nothing, and gcc is being annoying.
This commit is contained in:
parent
0d7a2ae4f5
commit
17f8b90736
@ -3170,7 +3170,7 @@ void apply_server_state(void)
|
|||||||
globalfilepathlen = 0;
|
globalfilepathlen = 0;
|
||||||
goto globalfileerror;
|
goto globalfileerror;
|
||||||
}
|
}
|
||||||
strncpy(globalfilepath, global.server_state_base, len);
|
memcpy(globalfilepath, global.server_state_base, len);
|
||||||
globalfilepath[globalfilepathlen] = 0;
|
globalfilepath[globalfilepathlen] = 0;
|
||||||
|
|
||||||
/* append a slash if needed */
|
/* append a slash if needed */
|
||||||
@ -3239,7 +3239,7 @@ void apply_server_state(void)
|
|||||||
localfilepathlen = 0;
|
localfilepathlen = 0;
|
||||||
goto localfileerror;
|
goto localfileerror;
|
||||||
}
|
}
|
||||||
strncpy(localfilepath, global.server_state_base, len);
|
memcpy(localfilepath, global.server_state_base, len);
|
||||||
localfilepath[localfilepathlen] = 0;
|
localfilepath[localfilepathlen] = 0;
|
||||||
|
|
||||||
/* append a slash if needed */
|
/* append a slash if needed */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user