summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openbsd-compat/bsd-closefrom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c
index 9380b33a7..b56476a2d 100644
--- a/openbsd-compat/bsd-closefrom.c
+++ b/openbsd-compat/bsd-closefrom.c
@@ -77,7 +77,7 @@ closefrom(int lowfd)
77 77
78 /* Check for a /proc/$$/fd directory. */ 78 /* Check for a /proc/$$/fd directory. */
79 len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid()); 79 len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid());
80 if (len > 0 && (size_t)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) { 80 if (len > 0 && (size_t)len < sizeof(fdpath) && (dirp = opendir(fdpath))) {
81 while ((dent = readdir(dirp)) != NULL) { 81 while ((dent = readdir(dirp)) != NULL) {
82 fd = strtol(dent->d_name, &endp, 10); 82 fd = strtol(dent->d_name, &endp, 10);
83 if (dent->d_name != endp && *endp == '\0' && 83 if (dent->d_name != endp && *endp == '\0' &&