aboutsummaryrefslogtreecommitdiff
path: root/loslib.c
diff options
context:
space:
mode:
Diffstat (limited to 'loslib.c')
-rw-r--r--loslib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/loslib.c b/loslib.c
index b043f679..b04a46d8 100644
--- a/loslib.c
+++ b/loslib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loslib.c,v 1.59 2015/07/06 15:16:51 roberto Exp roberto $ 2** $Id: loslib.c,v 1.60 2015/11/19 19:16:22 roberto Exp roberto $
3** Standard Operating System library 3** Standard Operating System library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -210,18 +210,18 @@ static int getboolfield (lua_State *L, const char *key) {
210 210
211static int getfield (lua_State *L, const char *key, int d, int delta) { 211static int getfield (lua_State *L, const char *key, int d, int delta) {
212 int isnum; 212 int isnum;
213 int t = lua_getfield(L, -1, key); 213 int t = lua_getfield(L, -1, key); /* get field and its type */
214 lua_Integer res = lua_tointegerx(L, -1, &isnum); 214 lua_Integer res = lua_tointegerx(L, -1, &isnum);
215 if (!isnum) { /* field is not a number? */ 215 if (!isnum) { /* field is not an integer? */
216 if (t != LUA_TNIL) /* some other value? */ 216 if (t != LUA_TNIL) /* some other value? */
217 return luaL_error(L, "field '%s' not an integer", key); 217 return luaL_error(L, "field '%s' is not an integer", key);
218 else if (d < 0) /* absent field; no default? */ 218 else if (d < 0) /* absent field; no default? */
219 return luaL_error(L, "field '%s' missing in date table", key); 219 return luaL_error(L, "field '%s' missing in date table", key);
220 res = d; 220 res = d;
221 } 221 }
222 else { 222 else {
223 if (!(-L_MAXDATEFIELD <= res && res <= L_MAXDATEFIELD)) 223 if (!(-L_MAXDATEFIELD <= res && res <= L_MAXDATEFIELD))
224 return luaL_error(L, "field '%s' out-of-bounds", key); 224 return luaL_error(L, "field '%s' is out-of-bound", key);
225 res -= delta; 225 res -= delta;
226 } 226 }
227 lua_pop(L, 1); 227 lua_pop(L, 1);