diff options
Diffstat (limited to '')
-rw-r--r-- | coreutils/diff.c | 9 |
1 files changed, 2 insertions, 7 deletions
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) | |||
1158 | while (*dirlist2 != NULL && strcmp(*dirlist2, start) < 0) | 1158 | while (*dirlist2 != NULL && strcmp(*dirlist2, start) < 0) |
1159 | dirlist2++; | 1159 | dirlist2++; |
1160 | if ((*dirlist1 == NULL) || (*dirlist2 == NULL)) | 1160 | if ((*dirlist1 == NULL) || (*dirlist2 == NULL)) |
1161 | bb_error_msg("Invalid argument to -S"); | 1161 | bb_error_msg(bb_msg_invalid_arg, "NULL", "-S"); |
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | /* Now that both dirlist1 and dirlist2 contain sorted directory | 1164 | /* Now that both dirlist1 and dirlist2 contain sorted directory |
@@ -1194,7 +1194,6 @@ static void diffdir(char *p1, char *p2) | |||
1194 | 1194 | ||
1195 | int diff_main(int argc, char **argv) | 1195 | int diff_main(int argc, char **argv) |
1196 | { | 1196 | { |
1197 | char *ep; | ||
1198 | int gotstdin = 0; | 1197 | int gotstdin = 0; |
1199 | 1198 | ||
1200 | char *U_opt; | 1199 | char *U_opt; |
@@ -1229,11 +1228,7 @@ int diff_main(int argc, char **argv) | |||
1229 | 1228 | ||
1230 | context = 3; /* This is the default number of lines of context. */ | 1229 | context = 3; /* This is the default number of lines of context. */ |
1231 | if (cmd_flags & FLAG_U) { | 1230 | if (cmd_flags & FLAG_U) { |
1232 | context = strtol(U_opt, &ep, 10); | 1231 | context = bb_xgetlarg(U_opt, 10, 1, INT_MAX); |
1233 | if (context == 0) { | ||
1234 | bb_error_msg("Invalid context length"); | ||
1235 | bb_show_usage(); | ||
1236 | } | ||
1237 | } | 1232 | } |
1238 | argc -= optind; | 1233 | argc -= optind; |
1239 | argv += optind; | 1234 | argv += optind; |