From: Thomas Weißschuh Date: Sun, 24 Dec 2023 13:12:52 +0000 (+0100) Subject: logger: use strncpy instead of strcpy X-Git-Tag: v2.40-rc1~84^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9f3e991780b77f982edd64de11248ee57df8d8e;p=thirdparty%2Futil-linux.git logger: use strncpy instead of strcpy This is not strictly necessary but better style. Signed-off-by: Thomas Weißschuh --- diff --git a/misc-utils/logger.c b/misc-utils/logger.c index 980412bebb..78103d21ec 100644 --- a/misc-utils/logger.c +++ b/misc-utils/logger.c @@ -248,7 +248,7 @@ static int unix_socket(struct logger_ctl *ctl, const char *path, int *socket_typ errx(EXIT_FAILURE, _("openlog %s: pathname too long"), path); s_addr.sun_family = AF_UNIX; - strcpy(s_addr.sun_path, path); + strncpy(s_addr.sun_path, path, sizeof(s_addr.sun_path)); for (i = 2; i; i--) { int st = -1;