aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
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