aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-10-08 09:43:34 +0000
committerEric Andersen <andersen@codepoet.org>2004-10-08 09:43:34 +0000
commitad63cb25140996588f223b009b094f1408a52a4b (patch)
treec0f46fb59d6abce8d925f09b3bb0c36becf9d61c
parenta62665b72fa7f956a54de5e173fffcb5a06f8157 (diff)
downloadbusybox-w32-ad63cb25140996588f223b009b094f1408a52a4b.tar.gz
busybox-w32-ad63cb25140996588f223b009b094f1408a52a4b.tar.bz2
busybox-w32-ad63cb25140996588f223b009b094f1408a52a4b.zip
Fix CONFIG_ASH_MATH_SUPPORT_64 so it actually works
-rw-r--r--shell/ash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c
index a5929044b..d9ea2b0f3 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13271,7 +13271,7 @@ arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr)
13271 if(numptr_val < 0) 13271 if(numptr_val < 0)
13272 return -3; /* exponent less than 0 */ 13272 return -3; /* exponent less than 0 */
13273 else { 13273 else {
13274 long c = 1; 13274 arith_t c = 1;
13275 13275
13276 if(numptr_val) 13276 if(numptr_val)
13277 while(numptr_val--) 13277 while(numptr_val--)
@@ -13294,7 +13294,7 @@ arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr)
13294 goto err; 13294 goto err;
13295 } 13295 }
13296 /* save to shell variable */ 13296 /* save to shell variable */
13297 sprintf(buf, "%lld", (long long) rez); 13297 snprintf(buf, sizeof(buf), "%lld", (long long) rez);
13298 setvar(numptr_m1->var, buf, 0); 13298 setvar(numptr_m1->var, buf, 0);
13299 /* after saving, make previous value for v++ or v-- */ 13299 /* after saving, make previous value for v++ or v-- */
13300 if(op == TOK_POST_INC) 13300 if(op == TOK_POST_INC)
@@ -13420,7 +13420,7 @@ static arith_t arith (const char *expr, int *perrcode)
13420 goto prologue; 13420 goto prologue;
13421 } 13421 }
13422 if((p = endofname(expr)) != expr) { 13422 if((p = endofname(expr)) != expr) {
13423 int var_name_size = (p-expr) + 1; /* trailing zero */ 13423 size_t var_name_size = (p-expr) + 1; /* trailing zero */
13424 13424
13425 numstackptr->var = alloca(var_name_size); 13425 numstackptr->var = alloca(var_name_size);
13426 safe_strncpy(numstackptr->var, expr, var_name_size); 13426 safe_strncpy(numstackptr->var, expr, var_name_size);
@@ -13432,7 +13432,7 @@ static arith_t arith (const char *expr, int *perrcode)
13432 continue; 13432 continue;
13433 } else if (is_digit(arithval)) { 13433 } else if (is_digit(arithval)) {
13434 numstackptr->var = NULL; 13434 numstackptr->var = NULL;
13435 numstackptr->val = strtol(expr, (char **) &expr, 0); 13435 numstackptr->val = strtoll(expr, (char **) &expr, 0);
13436 goto num; 13436 goto num;
13437 } 13437 }
13438 for(p = op_tokens; ; p++) { 13438 for(p = op_tokens; ; p++) {