From f4532f9fd377898c339aaa81cde66c14808248dd Mon Sep 17 00:00:00 2001 From: aldot Date: Wed, 7 Jun 2006 20:17:41 +0000 Subject: - reuse strings and messages. Saves about 600B git-svn-id: svn://busybox.net/trunk/busybox@15325 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- coreutils/diff.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'coreutils/diff.c') diff --git a/coreutils/diff.c b/coreutils/diff.c index 57b32eb78..786e2a8ab 100644 --- a/coreutils/diff.c +++ b/coreutils/diff.c @@ -1158,7 +1158,7 @@ static void diffdir(char *p1, char *p2) while (*dirlist2 != NULL && strcmp(*dirlist2, start) < 0) dirlist2++; if ((*dirlist1 == NULL) || (*dirlist2 == NULL)) - bb_error_msg("Invalid argument to -S"); + bb_error_msg(bb_msg_invalid_arg, "NULL", "-S"); } /* Now that both dirlist1 and dirlist2 contain sorted directory @@ -1194,7 +1194,6 @@ static void diffdir(char *p1, char *p2) int diff_main(int argc, char **argv) { - char *ep; int gotstdin = 0; char *U_opt; @@ -1229,11 +1228,7 @@ int diff_main(int argc, char **argv) context = 3; /* This is the default number of lines of context. */ if (cmd_flags & FLAG_U) { - context = strtol(U_opt, &ep, 10); - if (context == 0) { - bb_error_msg("Invalid context length"); - bb_show_usage(); - } + context = bb_xgetlarg(U_opt, 10, 1, INT_MAX); } argc -= optind; argv += optind; -- cgit v1.2.3-55-g6feb