summaryrefslogtreecommitdiff
path: root/coreutils/diff.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-06-07 20:17:41 +0000
committerBernhard Reutner-Fischer2006-06-07 20:17:41 +0000
commit19008b83735341c91fa8a09a072ffe9816c9e423 (patch)
tree6e35288c247102998a775cbc16f9ec014e00e7fd /coreutils/diff.c
parent4c5ad2fc90389bf1239f17d84967d07b82f31dd7 (diff)
downloadbusybox-19008b83735341c91fa8a09a072ffe9816c9e423.zip
busybox-19008b83735341c91fa8a09a072ffe9816c9e423.tar.gz
- reuse strings and messages. Saves about 600B
Diffstat (limited to 'coreutils/diff.c')
-rw-r--r--coreutils/diff.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/coreutils/diff.c b/coreutils/diff.c
index 57b32eb..786e2a8 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;