From c5da4f4cd067a2efa2a8f0f14f3034ed0b635f4d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 30 Nov 2011 11:03:24 -0200 Subject: [PATCH] unused variable removed --- lbaselib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lbaselib.c b/lbaselib.c index ce868ef7..35043c5b 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.271 2011/11/29 15:55:08 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.272 2011/11/30 12:42:21 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -288,7 +288,6 @@ static int luaB_loadfile (lua_State *L) { ** reserved slot inside the stack. */ static const char *generic_reader (lua_State *L, void *ud, size_t *size) { - const char *s; (void)(ud); /* not used */ luaL_checkstack(L, 2, "too many nested functions"); lua_pushvalue(L, 1); /* get function */ @@ -297,7 +296,7 @@ static const char *generic_reader (lua_State *L, void *ud, size_t *size) { *size = 0; return NULL; } - else if ((s = lua_tostring(L, -1)) == NULL) + else if (!lua_isstring(L, -1)) luaL_error(L, "reader function must return a string"); lua_replace(L, RESERVEDSLOT); /* save string in reserved slot */ return lua_tolstring(L, RESERVEDSLOT, size);