diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2016-01-07 21:17:06 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2016-01-07 21:17:06 +0000 |
commit | efdfa44abcf62c6ed5aa3fb65ad7b0aa6644fa04 (patch) | |
tree | c43bcd0b76f8a20227761e2f3a376ea14b36c52e /bin/expr/expr.c | |
parent | 236465ac5ced2c3f58c52e38673d1f576a3599b0 (diff) |
need to increase INT_MAX to 64 bits too. from Nathan Holstein
Diffstat (limited to 'bin/expr/expr.c')
-rw-r--r-- | bin/expr/expr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/expr/expr.c b/bin/expr/expr.c index acfebe3cc68..b22268d5141 100644 --- a/bin/expr/expr.c +++ b/bin/expr/expr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expr.c,v 1.24 2016/01/06 17:53:14 tedu Exp $ */ +/* $OpenBSD: expr.c,v 1.25 2016/01/07 21:17:05 tedu Exp $ */ /* $NetBSD: expr.c,v 1.3.6.1 1996/06/04 20:41:47 cgd Exp $ */ /* @@ -7,6 +7,7 @@ */ #include <stdio.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <limits.h> @@ -331,10 +332,10 @@ eval4(void) errx(2, "division by zero"); } if (op == DIV) { - if (l->u.i != INT_MIN || r->u.i != -1) + if (l->u.i != INT64_MIN || r->u.i != -1) l->u.i /= r->u.i; } else { - if (l->u.i != INT_MIN || r->u.i != -1) + if (l->u.i != INT64_MIN || r->u.i != -1) l->u.i %= r->u.i; else l->u.i = 0; |