summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-07-20 21:13:04 +0000
committerJim Meyering <jim@meyering.net>2003-07-20 21:13:04 +0000
commit1eb0fd1dd12316b4033605d95dd3111f1204ac64 (patch)
treedc269f27718a6d75092851b672455d0c14465340
parent1fb0960527f7ce534048edb8e2a19826eba5043c (diff)
downloadcoreutils-1eb0fd1dd12316b4033605d95dd3111f1204ac64.tar.xz
(get_input_fstatus): Fix typo: `stat' was being
invoked with a null pointer when there were no file arguments.
-rw-r--r--src/wc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wc.c b/src/wc.c
index 8f3f6791c..8647fd77d 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -554,7 +554,7 @@ get_input_fstatus (int nfiles, char * const *file)
int i;
for (i = 0; i < nfiles; i++)
- fstatus[i].failed = (file[i] && STREQ (file[i], "-")
+ fstatus[i].failed = (! file[i] || STREQ (file[i], "-")
? fstat (STDIN_FILENO, &fstatus[i].st)
: stat (file[i], &fstatus[i].st));
}