diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-08-04 17:53:13 -0400 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-08-04 17:53:13 -0400 |
| commit | a4938b083eab1160ab441be9e70d86a2e4a22266 (patch) | |
| tree | a19cb22e7a2adf48b627a0b2d1ebc3ef62bbacbc | |
| parent | f7355af9f01901e51db4981be536142959538c9f (diff) | |
add diagnositic for failure to open file
| -rw-r--r-- | strings.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -23,10 +23,12 @@ */ #define _POSIX_C_SOURCE 2 +#include <ctype.h> +#include <errno.h> #include <locale.h> #include <stdio.h> #include <stdlib.h> -#include <ctype.h> +#include <string.h> #include <unistd.h> static int strings(const char *path, size_t number, char format) @@ -37,6 +39,7 @@ static int strings(const char *path, size_t number, char format) } if (f == NULL) { + fprintf(stderr, "strings: %s: %s\n", path, strerror(errno)); return 1; } |
