From 6261eab8d81a6901201cb711283da6281db193ec Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 12 Mar 2013 17:21:49 +0100 Subject: Fixed a little APICHECK issue --- src/lanes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lanes.c b/src/lanes.c index 7bd29ee..f792293 100644 --- a/src/lanes.c +++ b/src/lanes.c @@ -914,10 +914,11 @@ static void linda_id( lua_State*L, char const * const which) struct s_Linda *s; size_t name_len = 0; char const* linda_name = NULL; + int const top = lua_gettop( L); - if( lua_type( L, lua_gettop( L)) == LUA_TSTRING) + if( top > 0 && lua_type( L, top) == LUA_TSTRING) { - linda_name = lua_tostring( L, lua_gettop( L)); + linda_name = lua_tostring( L, top); name_len = strlen( linda_name); } -- cgit v1.2.3-55-g6feb