summaryrefslogtreecommitdiffstats
path: root/usr.bin/file/apprentice.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/file/apprentice.c')
-rw-r--r--usr.bin/file/apprentice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/file/apprentice.c b/usr.bin/file/apprentice.c
index f5d0b6be3da..e19382a19a8 100644
--- a/usr.bin/file/apprentice.c
+++ b/usr.bin/file/apprentice.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apprentice.c,v 1.31 2014/05/18 17:50:11 espie Exp $ */
+/* $OpenBSD: apprentice.c,v 1.32 2014/10/26 04:10:26 brad Exp $ */
/*
* Copyright (c) Ian F. Darwin 1986-1995.
* Software written by Ian F. Darwin and others;
@@ -642,7 +642,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
if (stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
dir = opendir(fn);
if (dir) {
- while (d = readdir(dir)) {
+ while ((d = readdir(dir)) != NULL) {
snprintf(subfn, sizeof(subfn), "%s/%s",
fn, d->d_name);
if (stat(subfn, &st) == 0 && S_ISREG(st.st_mode)) {