summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inotail.c3
-rw-r--r--inotail.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/inotail.c b/inotail.c
index bb27702..075bb5d 100644
--- a/inotail.c
+++ b/inotail.c
@@ -30,7 +30,6 @@
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
-#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -451,7 +450,7 @@ int main(int argc, char **argv)
} else if (*optarg == '-')
optarg++;
- if (!isdigit(*optarg)) {
+ if (!is_digit(*optarg)) {
fprintf(stderr, "Invalid number of lines: %s\n", optarg);
exit(EXIT_FAILURE);
}
diff --git a/inotail.h b/inotail.h
index 4c57867..836c1de 100644
--- a/inotail.h
+++ b/inotail.h
@@ -29,6 +29,8 @@ struct file_struct {
#define IS_TAILABLE(mode) \
(S_ISREG(mode) || IS_PIPELIKE(mode) || S_ISCHR(mode))
+#define is_digit(c) ((c) >= '0' && (c) <= '9')
+
#ifdef DEBUG
# define dprintf(fmt, args...) fprintf(stderr, fmt, ##args)
#else