diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-03-14 09:40:44 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-03-14 09:40:44 -0300 |
| commit | 1a1b2f3d7f321dd6f28118c985986940b189c635 (patch) | |
| tree | 14cffeb82724b5673ded4e9a3c5bde7f53e065d3 /loslib.c | |
| parent | f5f3df3bd17fb3489bbd26ab39fe1580a8dbf9c9 (diff) | |
| download | lua-1a1b2f3d7f321dd6f28118c985986940b189c635.tar.gz lua-1a1b2f3d7f321dd6f28118c985986940b189c635.tar.bz2 lua-1a1b2f3d7f321dd6f28118c985986940b189c635.zip | |
added 'return' to calls to 'luaL_error' (to signal to the compiler
that the function cannot continue past that call)
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 | } |
