summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/head.c3
-rw-r--r--coreutils/tail.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/head.c b/coreutils/head.c
index c5c11fc..ad21e1b 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -25,6 +25,7 @@
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include "busybox.h"
static int head(int len, FILE *fp)
@@ -47,7 +48,7 @@ int head_main(int argc, char **argv)
FILE *fp;
int need_headers, opt, len = 10, status = EXIT_SUCCESS;
- if (( argc >= 2 ) && ( strlen ( argv [1] ) >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
+ if (( argc >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
len = atoi ( &argv [1][1] );
optind = 2;
}
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 8201c80..024441e 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -25,6 +25,7 @@
#include <fcntl.h>
#include <getopt.h>
#include <string.h>
+#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@@ -68,7 +69,7 @@ int tail_main(int argc, char **argv)
char *s, *start, *end, buf[BUFSIZ];
int i, opt;
- if (( argc >= 2 ) && ( strlen ( argv [1] ) >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
+ if (( argc >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
count = atoi ( &argv [1][1] );
optind = 2;
}