aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-30 10:42:49 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-30 10:42:49 -0200
commite21b26a964774e29f24e5f6ae97808fdb5bce9d5 (patch)
treef512c9e2843fdc12c5bba13e17346633893b3dc3 /lbaselib.c
parent0f388193b3d00571126abadfd4dc9bf02ea17b24 (diff)
downloadlua-e21b26a964774e29f24e5f6ae97808fdb5bce9d5.tar.gz
lua-e21b26a964774e29f24e5f6ae97808fdb5bce9d5.tar.bz2
lua-e21b26a964774e29f24e5f6ae97808fdb5bce9d5.zip
avoid 'return' "to avoid warnings"
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lbaselib.c b/lbaselib.c
index ccc3123a..ce868ef7 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.270 2011/11/23 17:29:04 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.271 2011/11/29 15:55:08 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*/
@@ -297,14 +297,10 @@ static const char *generic_reader (lua_State *L, void *ud, size_t *size) {
297 *size = 0; 297 *size = 0;
298 return NULL; 298 return NULL;
299 } 299 }
300 else if ((s = lua_tostring(L, -1)) != NULL) { 300 else if ((s = lua_tostring(L, -1)) == NULL)
301 lua_replace(L, RESERVEDSLOT); /* save string in reserved slot */
302 return lua_tolstring(L, RESERVEDSLOT, size);
303 }
304 else {
305 luaL_error(L, "reader function must return a string"); 301 luaL_error(L, "reader function must return a string");
306 return NULL; /* to avoid warnings */ 302 lua_replace(L, RESERVEDSLOT); /* save string in reserved slot */
307 } 303 return lua_tolstring(L, RESERVEDSLOT, size);
308} 304}
309 305
310 306