aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 c5c11fc7b..ad21e1b95 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -25,6 +25,7 @@
25#include <getopt.h> 25#include <getopt.h>
26#include <stdlib.h> 26#include <stdlib.h>
27#include <string.h> 27#include <string.h>
28#include <ctype.h>
28#include "busybox.h" 29#include "busybox.h"
29 30
30static int head(int len, FILE *fp) 31static int head(int len, FILE *fp)
@@ -47,7 +48,7 @@ int head_main(int argc, char **argv)
47 FILE *fp; 48 FILE *fp;
48 int need_headers, opt, len = 10, status = EXIT_SUCCESS; 49 int need_headers, opt, len = 10, status = EXIT_SUCCESS;
49 50
50 if (( argc >= 2 ) && ( strlen ( argv [1] ) >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) { 51 if (( argc >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
51 len = atoi ( &argv [1][1] ); 52 len = atoi ( &argv [1][1] );
52 optind = 2; 53 optind = 2;
53 } 54 }
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 8201c80a0..024441e73 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -25,6 +25,7 @@
25#include <fcntl.h> 25#include <fcntl.h>
26#include <getopt.h> 26#include <getopt.h>
27#include <string.h> 27#include <string.h>
28#include <ctype.h>
28#include <stdlib.h> 29#include <stdlib.h>
29#include <unistd.h> 30#include <unistd.h>
30#include <sys/types.h> 31#include <sys/types.h>
@@ -68,7 +69,7 @@ int tail_main(int argc, char **argv)
68 char *s, *start, *end, buf[BUFSIZ]; 69 char *s, *start, *end, buf[BUFSIZ];
69 int i, opt; 70 int i, opt;
70 71
71 if (( argc >= 2 ) && ( strlen ( argv [1] ) >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) { 72 if (( argc >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
72 count = atoi ( &argv [1][1] ); 73 count = atoi ( &argv [1][1] );
73 optind = 2; 74 optind = 2;
74 } 75 }