diff options
author | 2014-10-26 04:10:26 +0000 | |
---|---|---|
committer | 2014-10-26 04:10:26 +0000 | |
commit | 6ec364a7704b6515978a761d9b22b52f43dc32bd (patch) | |
tree | 177384331bf5b940f9838915b6499807948e1cba /usr.bin/file/apprentice.c | |
parent | Add a format specifier for the printf. (diff) | |
download | wireguard-openbsd-6ec364a7704b6515978a761d9b22b52f43dc32bd.tar.xz wireguard-openbsd-6ec364a7704b6515978a761d9b22b52f43dc32bd.zip |
Place additional parantheses around readdir() and check return does not
equal NULL.
apprentice.c:645:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
With input and ok guenther@
Diffstat (limited to 'usr.bin/file/apprentice.c')
-rw-r--r-- | usr.bin/file/apprentice.c | 4 |
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)) { |