diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-03 21:13:31 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-03 21:13:31 +0000 |
commit | cc8289dc0498d50734770d06601756f7ddc55168 (patch) | |
tree | 4cb2b67a14d5aa6bc4a46cc14cf612d647f00752 | |
parent | 60b392fd5bd49af2813b3970940e75516bf1e5dd (diff) | |
download | busybox-w32-cc8289dc0498d50734770d06601756f7ddc55168.tar.gz busybox-w32-cc8289dc0498d50734770d06601756f7ddc55168.tar.bz2 busybox-w32-cc8289dc0498d50734770d06601756f7ddc55168.zip |
shell/math: randomconfig fix
-rw-r--r-- | shell/math.c | 6 | ||||
-rw-r--r-- | shell/math.h | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/shell/math.c b/shell/math.c index 9a46a937e..8a44c8e88 100644 --- a/shell/math.c +++ b/shell/math.c | |||
@@ -414,14 +414,14 @@ arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr, a_e_h_t *math_hoo | |||
414 | rez %= numptr_val; | 414 | rez %= numptr_val; |
415 | } | 415 | } |
416 | if (tok_have_assign(op)) { | 416 | if (tok_have_assign(op)) { |
417 | char buf[sizeof(arith_t_type)*3 + 2]; | 417 | char buf[sizeof(arith_t)*3 + 2]; |
418 | 418 | ||
419 | if (numptr_m1->var == NULL) { | 419 | if (numptr_m1->var == NULL) { |
420 | /* Hmm, 1=2 ? */ | 420 | /* Hmm, 1=2 ? */ |
421 | goto err; | 421 | goto err; |
422 | } | 422 | } |
423 | /* save to shell variable */ | 423 | /* save to shell variable */ |
424 | snprintf(buf, sizeof(buf), arith_t_fmt, (arith_t_type) rez); | 424 | sprintf(buf, arith_t_fmt, rez); |
425 | setvar(numptr_m1->var, buf, 0); | 425 | setvar(numptr_m1->var, buf, 0); |
426 | /* after saving, make previous value for v++ or v-- */ | 426 | /* after saving, make previous value for v++ or v-- */ |
427 | if (op == TOK_POST_INC) | 427 | if (op == TOK_POST_INC) |
@@ -668,7 +668,7 @@ arith(const char *expr, int *perrcode, a_e_h_t *math_hooks) | |||
668 | } /* while */ | 668 | } /* while */ |
669 | } | 669 | } |
670 | 670 | ||
671 | /*- | 671 | /* |
672 | * Copyright (c) 1989, 1991, 1993, 1994 | 672 | * Copyright (c) 1989, 1991, 1993, 1994 |
673 | * The Regents of the University of California. All rights reserved. | 673 | * The Regents of the University of California. All rights reserved. |
674 | * | 674 | * |
diff --git a/shell/math.h b/shell/math.h index a52680923..195fc20ba 100644 --- a/shell/math.h +++ b/shell/math.h | |||
@@ -76,13 +76,11 @@ | |||
76 | #define _SHELL_MATH_ | 76 | #define _SHELL_MATH_ |
77 | 77 | ||
78 | #if ENABLE_SH_MATH_SUPPORT_64 | 78 | #if ENABLE_SH_MATH_SUPPORT_64 |
79 | typedef int64_t arith_t; | 79 | typedef long long arith_t; |
80 | #define arith_t_type long long | ||
81 | #define arith_t_fmt "%lld" | 80 | #define arith_t_fmt "%lld" |
82 | #define strto_arith_t strtoll | 81 | #define strto_arith_t strtoll |
83 | #else | 82 | #else |
84 | typedef long arith_t; | 83 | typedef long arith_t; |
85 | #define arith_t_type long | ||
86 | #define arith_t_fmt "%ld" | 84 | #define arith_t_fmt "%ld" |
87 | #define strto_arith_t strtol | 85 | #define strto_arith_t strtol |
88 | #endif | 86 | #endif |