From f373225ac654818363e3f48cadfbcb6dcc4053be Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 27 Dec 2012 23:40:45 +0100 Subject: [PATCH] ctl: don't use a #define to define size, use sizeof() --- src/ctl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ctl.c b/src/ctl.c index 1d8cae65..b730c8cf 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -29,9 +29,6 @@ #include "log.h" #include "compat/compat.h" -/* Linux: 108. OpenBSD: 104. */ -#define UNIX_PATH_MAX 104 - /** * Create a new listening Unix socket for control protocol. * @@ -50,7 +47,7 @@ ctl_create(char *name) if ((s = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) return -1; su.sun_family = AF_UNIX; - strlcpy(su.sun_path, name, UNIX_PATH_MAX); + strlcpy(su.sun_path, name, sizeof(su.sun_path)); if (bind(s, (struct sockaddr *)&su, sizeof(struct sockaddr_un)) == -1) { rc = errno; close(s); errno = rc; return -1; -- 2.39.5