aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-07-10 14:15:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-07-10 14:15:12 -0300
commit2f8c51a5529686959c6f6c5a8e899127b16c345d (patch)
tree6fcd69bf68ed7595578db0e196ad29863faf6257 /lbaselib.c
parentb5f5fcd78251300aee44d958b9ac000fa05e0478 (diff)
downloadlua-2f8c51a5529686959c6f6c5a8e899127b16c345d.tar.gz
lua-2f8c51a5529686959c6f6c5a8e899127b16c345d.tar.bz2
lua-2f8c51a5529686959c6f6c5a8e899127b16c345d.zip
use unsigneds for unary minus, too
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 30e19ee4..f3964c70 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.278 2013/07/05 14:35:49 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.279 2013/07/05 14:39:15 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -63,7 +63,7 @@ static int b_str2int (const char *s, const char *e, int base, lua_Integer *pn) {
63 s += strspn(s, SPACECHARS); /* skip trailing spaces */ 63 s += strspn(s, SPACECHARS); /* skip trailing spaces */
64 if (s != e) /* invalid trailing characters? */ 64 if (s != e) /* invalid trailing characters? */
65 return 0; 65 return 0;
66 *pn = (neg) ? -(lua_Integer)n : (lua_Integer)n; 66 *pn = (lua_Integer)((neg) ? (0u - n) : n);
67 return 1; 67 return 1;
68} 68}
69 69