summaryrefslogtreecommitdiff
path: root/src/libsystemd-daemon/sd-daemon.c
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2012-12-17 11:13:17 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-12-17 11:41:31 +0100
commitd1d7caeeee65c11c54ee1ce0a878024715208a75 (patch)
tree22973b54ce9008b138966261b38247f2252457c2 /src/libsystemd-daemon/sd-daemon.c
parent23757887f768b0b7339239cc98aee879d9f4d87f (diff)
sd-daemon: fix cppcheck warnings
Found with 'cppcheck --enable=all --inconclusive --std=posix' while working with util-linux, which has a copy of this file. [misc-utils/sd-daemon.c:363]: (style) Checking if unsigned variable \ 'length' is less than zero. [misc-utils/sd-daemon.c:366]: (style) Checking if unsigned variable \ 'length' is less than zero. References: http://www.spinics.net/lists/util-linux-ng/msg07031.html
Diffstat (limited to 'src/libsystemd-daemon/sd-daemon.c')
-rw-r--r--src/libsystemd-daemon/sd-daemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c
index 4801d2cd18..80aadf7adf 100644
--- a/src/libsystemd-daemon/sd-daemon.c
+++ b/src/libsystemd-daemon/sd-daemon.c
@@ -364,10 +364,10 @@ _sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *p
return 0;
if (path) {
- if (length <= 0)
+ if (length == 0)
length = strlen(path);
- if (length <= 0)
+ if (length == 0)
/* Unnamed socket */
return l == offsetof(struct sockaddr_un, sun_path);