diff options
author | jilles <jilles@FreeBSD.org> | 2011-03-05 13:27:13 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-03-05 13:27:13 +0000 |
commit | 1a2c2ccf00d839e96bbb9cb391027b14ec4e0d05 (patch) | |
tree | bf3a5f469de7c275fad2760418405b1e77622289 /bin | |
parent | 0525662d5901332ebbcb7efce6b84f542e493cfc (diff) | |
download | FreeBSD-src-1a2c2ccf00d839e96bbb9cb391027b14ec4e0d05.zip FreeBSD-src-1a2c2ccf00d839e96bbb9cb391027b14ec4e0d05.tar.gz |
sh: Fix some warnings in code for arithmetic expressions.
Submitted by: eadler
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/arith_yacc.c | 4 | ||||
-rw-r--r-- | bin/sh/arith_yylex.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/bin/sh/arith_yacc.c b/bin/sh/arith_yacc.c index 8aab8fb..edb321f 100644 --- a/bin/sh/arith_yacc.c +++ b/bin/sh/arith_yacc.c @@ -198,7 +198,7 @@ again: } } -static arith_t binop2(arith_t a, int op, int prec, int noeval) +static arith_t binop2(arith_t a, int op, int precedence, int noeval) { for (;;) { union yystype val; @@ -221,7 +221,7 @@ static arith_t binop2(arith_t a, int op, int prec, int noeval) a = noeval ? b : do_binop(op, a, b); if (op2 < ARITH_BINOP_MIN || op2 >= ARITH_BINOP_MAX || - arith_prec(op2) >= prec) + arith_prec(op2) >= precedence) return a; op = op2; diff --git a/bin/sh/arith_yylex.c b/bin/sh/arith_yylex.c index 0d08a83..08e43a4 100644 --- a/bin/sh/arith_yylex.c +++ b/bin/sh/arith_yylex.c @@ -57,6 +57,7 @@ yylex() { int value; const char *buf = arith_buf; + char *end; const char *p; for (;;) { @@ -79,7 +80,8 @@ yylex() case '7': case '8': case '9': - yylval.val = strtoarith_t(buf, (char **)&arith_buf, 0); + yylval.val = strtoarith_t(buf, (char **)&end, 0); + arith_buf = end; return ARITH_NUM; case 'A': case 'B': |