]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
ctl: don't use a #define to define size, use sizeof()
authorVincent Bernat <bernat@luffy.cx>
Thu, 27 Dec 2012 22:40:45 +0000 (23:40 +0100)
committerVincent Bernat <bernat@luffy.cx>
Thu, 27 Dec 2012 22:40:45 +0000 (23:40 +0100)
src/ctl.c

index 1d8cae65b36af66303d4fc7b613eb81e5a4edeed..b730c8cf11266dfbb088ceceb1f86e17d82dd35d 100644 (file)
--- 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;