summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-08-04 17:53:13 -0400
committerJakob Kaivo <jkk@ung.org>2019-08-04 17:53:13 -0400
commita4938b083eab1160ab441be9e70d86a2e4a22266 (patch)
treea19cb22e7a2adf48b627a0b2d1ebc3ef62bbacbc
parentf7355af9f01901e51db4981be536142959538c9f (diff)
add diagnositic for failure to open file
-rw-r--r--strings.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/strings.c b/strings.c
index 0256e3a..33d8dca 100644
--- a/strings.c
+++ b/strings.c
@@ -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;
}