From ae68ad65faf5d53a15549f1995f5683b4ba12c03 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 22 Apr 2009 22:38:16 +1000 Subject: findutils/xargs: do not subtract orig_arg_max to negative value --- findutils/xargs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) orig_arg_max = ARG_MAX; if (orig_arg_max == -1) orig_arg_max = LONG_MAX; - orig_arg_max -= 2048; /* POSIX.2 requires subtracting 2048 */ + if (orig_arg_max > 2048) + orig_arg_max -= 2048; /* POSIX.2 requires subtracting 2048 */ if (opt & OPT_UPTO_SIZE) { n_max_chars = xatoul_range(max_chars, 1, orig_arg_max); -- cgit v1.2.3-55-g6feb