aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--loc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/loc.c b/loc.c
index bd43584..855ad5b 100644
--- a/loc.c
+++ b/loc.c
@@ -163,7 +163,10 @@ main(int argc, char *argv[])
n = count(fd, argv[0]);
close(fd);
}
- printf("%zi\n", n);
+ if (n >= 0)
+ printf("%zi\n", n);
+ else
+ ret = 1;
} else {
if (!(res = calloc(argc, sizeof(struct result))))
fprintf(stderr, "%s: out of memory\n", argv0), exit(1);