diff options
Diffstat (limited to 'shell/math.c')
-rw-r--r-- | shell/math.c | 6 |
1 files changed, 3 insertions, 3 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 | * |