summaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 988f3d337..2488a6fdb 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -458,6 +458,7 @@ static int loop_scandir(const char *dirname, int **ary, int hasprefix)
/* /dev/loop/<N> */
char *end = NULL;
+ errno = 0;
n = strtol(d->d_name, &end, 10);
if (d->d_name == end || (end && *end) || errno)
continue;