From 1eb0fd1dd12316b4033605d95dd3111f1204ac64 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 20 Jul 2003 21:13:04 +0000 Subject: [PATCH] (get_input_fstatus): Fix typo: `stat' was being invoked with a null pointer when there were no file arguments. --- src/wc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wc.c b/src/wc.c index 8f3f6791c8..8647fd77de 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)); } -- 2.47.2