Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/bin/sh Pull up revision 1.52 (requested by itojun):



details:   https://anonhg.NetBSD.org/src/rev/7f26b04d2e5d
branches:  netbsd-1-4
changeset: 471312:7f26b04d2e5d
user:      he <he%NetBSD.org@localhost>
date:      Mon Jan 14 14:44:58 2002 +0000

description:
Pull up revision 1.52 (requested by itojun):
  Do not truncate expr > 10 digits.  Fixes PR#13943.

diffstat:

 bin/sh/expand.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 025f849d8d06 -r 7f26b04d2e5d bin/sh/expand.c
--- a/bin/sh/expand.c   Mon Jan 14 14:41:31 2002 +0000
+++ b/bin/sh/expand.c   Mon Jan 14 14:44:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expand.c,v 1.45.2.1 1999/04/07 17:24:02 he Exp $       */
+/*     $NetBSD: expand.c,v 1.45.2.2 2002/01/14 14:44:58 he Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c   8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.45.2.1 1999/04/07 17:24:02 he Exp $");
+__RCSID("$NetBSD: expand.c,v 1.45.2.2 2002/01/14 14:44:58 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -371,7 +371,10 @@
         * have to rescan starting from the beginning since CTLESC
         * characters have to be processed left to right.
         */
-       CHECKSTRSPACE(8, expdest);
+#if INT_MAX / 1000000000 >= 10 || INT_MIN / 1000000000 <= -10
+#error "integers with more than 10 digits are not supported"
+#endif
+       CHECKSTRSPACE(12 - 2, expdest);
        USTPUTC('\0', expdest);
        start = stackblock();
        p = expdest - 1;
@@ -393,7 +396,7 @@
        if (quotes)
                rmescapes(p+2);
        result = arith(p+2);
-       fmtstr(p, 10, "%d", result);
+       fmtstr(p, 12, "%d", result);
 
        while (*p++)
                ;



Home | Main Index | Thread Index | Old Index