]> granicus.if.org Git - sudo/commitdiff
Silence gcc -Wsign-compare; djm@openbsd.org
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Nov 2005 14:55:24 +0000 (14:55 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Nov 2005 14:55:24 +0000 (14:55 +0000)
closefrom.c

index cc39ca0abbe24a0f12519951892b982ff8e5ad91..8e3e8a3c66d8180bd606ae5929a0443ba9a3cf57 100644 (file)
@@ -67,7 +67,7 @@ closefrom(lowfd)
 
     /* Check for a /proc/$$/fd directory. */
     len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid());
-    if (len != -1 && len <= sizeof(fdpath) && (dirp = opendir(fdpath))) {
+    if (len > 0 && (size_t)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) {
        while ((dent = readdir(dirp)) != NULL) {
            fd = strtol(dent->d_name, &endp, 10);
            if (dent->d_name != endp && *endp == '\0' &&