aboutsummaryrefslogtreecommitdiff
path: root/coreutils/head.c
diff options
context:
space:
mode:
authorRobert Griebl <griebl@gmx.de>2002-05-27 22:24:53 +0000
committerRobert Griebl <griebl@gmx.de>2002-05-27 22:24:53 +0000
commit53146cc9ec7f3af5a8fa6245bf01c4f9c0fd19b4 (patch)
treec2296e39db1a62fc8d59cf9a64a2f46950b4b63b /coreutils/head.c
parent8302c43265a9f83baa96b15a6082954526988c8b (diff)
downloadbusybox-53146cc9ec7f3af5a8fa6245bf01c4f9c0fd19b4.tar.gz
Added include for isdigit(); simplified -<num> detection
Diffstat (limited to 'coreutils/head.c')
-rw-r--r--coreutils/head.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/head.c b/coreutils/head.c
index c5c11fc7b..ad21e1b95 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;
}