]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
ctl: fix previous partial commit about unix path max length
authorVincent Bernat <bernat@luffy.cx>
Thu, 27 Dec 2012 22:53:58 +0000 (23:53 +0100)
committerVincent Bernat <bernat@luffy.cx>
Thu, 27 Dec 2012 22:53:58 +0000 (23:53 +0100)
Never commit without compiling. Thanks Travis-CI for spotting this.

src/ctl.c

index b730c8cf11266dfbb088ceceb1f86e17d82dd35d..eba8396de2bf72013e0967e1b1b1400369e0facb 100644 (file)
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -80,7 +80,7 @@ ctl_connect(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 (connect(s, (struct sockaddr *)&su, sizeof(struct sockaddr_un)) == -1) {
                rc = errno;
                log_warn("control", "unable to connect to socket %s", name);