summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2008-04-28 07:26:34 +0000
committerstefanf <stefanf@FreeBSD.org>2008-04-28 07:26:34 +0000
commit44778d89a517abfd42b05a1b3862fc8f66366403 (patch)
tree11fb2e55dbbb95953863cef5107d6f00d1e2f004 /bin
parente919c282cde15d51fa314cf84ffeabac012e2859 (diff)
downloadFreeBSD-src-44778d89a517abfd42b05a1b3862fc8f66366403.zip
FreeBSD-src-44778d89a517abfd42b05a1b3862fc8f66366403.tar.gz
Sigh, when reapplying the patch to HEAD, I somehow forgot to commit this file.
Reported by: Jaakko Heinonen
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/expand.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 93df92d..1bd7079 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -356,7 +356,7 @@ void
expari(int flag)
{
char *p, *start;
- int result;
+ arith_t result;
int begoff;
int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);
int quoted;
@@ -372,10 +372,7 @@ expari(int flag)
* have to rescan starting from the beginning since CTLESC
* characters have to be processed left to right.
*/
-#if INT_MAX / 1000000000 >= 10 || INT_MIN / 1000000000 <= -10
-#error "integers with more than 10 digits are not supported"
-#endif
- CHECKSTRSPACE(12 - 2, expdest);
+ CHECKSTRSPACE(DIGITS(result) - 2, expdest);
USTPUTC('\0', expdest);
start = stackblock();
p = expdest - 2;
@@ -397,7 +394,7 @@ expari(int flag)
if (quotes)
rmescapes(p+2);
result = arith(p+2);
- fmtstr(p, 12, "%d", result);
+ fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result);
while (*p++)
;
if (quoted == 0)
OpenPOWER on IntegriCloud