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
This commit is contained in:
parent
23757887f7
commit
d1d7caeeee
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue