From 2f8c51a5529686959c6f6c5a8e899127b16c345d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 10 Jul 2013 14:15:12 -0300 Subject: use unsigneds for unary minus, too --- lbaselib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 30e19ee4..f3964c70 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.278 2013/07/05 14:35:49 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.279 2013/07/05 14:39:15 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -63,7 +63,7 @@ static int b_str2int (const char *s, const char *e, int base, lua_Integer *pn) { s += strspn(s, SPACECHARS); /* skip trailing spaces */ if (s != e) /* invalid trailing characters? */ return 0; - *pn = (neg) ? -(lua_Integer)n : (lua_Integer)n; + *pn = (lua_Integer)((neg) ? (0u - n) : n); return 1; } -- cgit v1.2.3-55-g6feb