fix typos
authorAlan T. DeKok <aland@freeradius.org>
Mon, 26 Sep 2016 14:54:26 +0000 (10:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 26 Sep 2016 14:54:26 +0000 (10:54 -0400)
src/lib/misc.c

index 79bae9a..f81289b 100644 (file)
@@ -1412,11 +1412,13 @@ int closefrom(int fd)
                while ((dp = readdir(dir)) != NULL) {
                        my_fd = strtol(dp->d_name, &endp, 10);
                        if (my_fd <= 0) continue;
-                       if ((dp->d_name != endp) && !*endp) continue;
+
+                       if ((endp > dp->d_name) && *endp) continue;
 
                        if (my_fd == dirfd(dir)) continue;
+
                        if ((my_fd >= fd) && (my_fd <= maxfd)) {
-                               (void) close((int) fd);
+                               (void) close((int) my_fd);
                        }
                }
                (void) closedir(dir);