aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lstrlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 786016b4..7eb62f37 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.219 2014/12/10 11:36:03 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.220 2014/12/11 13:40:40 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1034,8 +1034,8 @@ static int getnum (const char **fmt, int df) {
1034 else { 1034 else {
1035 int a = 0; 1035 int a = 0;
1036 do { 1036 do {
1037 a = a*10 + *((*fmt)++) - '0'; 1037 a = a*10 + (*((*fmt)++) - '0');
1038 } while (digit(**fmt) && a < ((int)MAXSIZE/10 - 10)); 1038 } while (digit(**fmt) && a <= ((int)MAXSIZE - 9)/10);
1039 return a; 1039 return a;
1040 } 1040 }
1041} 1041}