aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-22 22:38:16 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 04:44:40 +1000
commitae68ad65faf5d53a15549f1995f5683b4ba12c03 (patch)
tree9b79842130e9234c25a86504b1dfc907d40444ba
parentba71eb646163b316b721e135818cb04932bfa39c (diff)
downloadbusybox-w32-ae68ad65faf5d53a15549f1995f5683b4ba12c03.tar.gz
busybox-w32-ae68ad65faf5d53a15549f1995f5683b4ba12c03.tar.bz2
busybox-w32-ae68ad65faf5d53a15549f1995f5683b4ba12c03.zip
findutils/xargs: do not subtract orig_arg_max to negative value
-rw-r--r--findutils/xargs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 4ca95639a..3ff80836c 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -410,7 +410,8 @@ int xargs_main(int argc, char **argv)
410 orig_arg_max = ARG_MAX; 410 orig_arg_max = ARG_MAX;
411 if (orig_arg_max == -1) 411 if (orig_arg_max == -1)
412 orig_arg_max = LONG_MAX; 412 orig_arg_max = LONG_MAX;
413 orig_arg_max -= 2048; /* POSIX.2 requires subtracting 2048 */ 413 if (orig_arg_max > 2048)
414 orig_arg_max -= 2048; /* POSIX.2 requires subtracting 2048 */
414 415
415 if (opt & OPT_UPTO_SIZE) { 416 if (opt & OPT_UPTO_SIZE) {
416 n_max_chars = xatoul_range(max_chars, 1, orig_arg_max); 417 n_max_chars = xatoul_range(max_chars, 1, orig_arg_max);