diff options
Diffstat (limited to 'loslib.c')
-rw-r--r-- | loslib.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.64 2016/04/18 13:06:55 roberto Exp $ | 2 | ** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 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 | */ |
@@ -293,7 +293,8 @@ static int os_date (lua_State *L) { | |||
293 | else | 293 | else |
294 | stm = l_localtime(&t, &tmr); | 294 | stm = l_localtime(&t, &tmr); |
295 | if (stm == NULL) /* invalid date? */ | 295 | if (stm == NULL) /* invalid date? */ |
296 | luaL_error(L, "time result cannot be represented in this installation"); | 296 | return luaL_error(L, |
297 | "time result cannot be represented in this installation"); | ||
297 | if (strcmp(s, "*t") == 0) { | 298 | if (strcmp(s, "*t") == 0) { |
298 | lua_createtable(L, 0, 9); /* 9 = number of fields */ | 299 | lua_createtable(L, 0, 9); /* 9 = number of fields */ |
299 | setallfields(L, stm); | 300 | setallfields(L, stm); |
@@ -340,7 +341,8 @@ static int os_time (lua_State *L) { | |||
340 | setallfields(L, &ts); /* update fields with normalized values */ | 341 | setallfields(L, &ts); /* update fields with normalized values */ |
341 | } | 342 | } |
342 | if (t != (time_t)(l_timet)t || t == (time_t)(-1)) | 343 | if (t != (time_t)(l_timet)t || t == (time_t)(-1)) |
343 | luaL_error(L, "time result cannot be represented in this installation"); | 344 | return luaL_error(L, |
345 | "time result cannot be represented in this installation"); | ||
344 | l_pushtime(L, t); | 346 | l_pushtime(L, t); |
345 | return 1; | 347 | return 1; |
346 | } | 348 | } |