aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lauxlib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lauxlib.c b/lauxlib.c
index bdbe576c..ed82e8cd 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.190 2009/07/15 17:47:34 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.191 2009/09/18 18:58:45 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -672,7 +672,8 @@ LUALIB_API void luaL_register (lua_State *L, const char *libname,
672 } 672 }
673 lua_remove(L, -2); /* remove _LOADED table */ 673 lua_remove(L, -2); /* remove _LOADED table */
674 } 674 }
675 for (; l->name; l++) { 675 if (l == NULL) return; /* nothing to register? */
676 for (; l->name; l++) { /* else fill the table with given functions */
676 lua_pushcfunction(L, l->func); 677 lua_pushcfunction(L, l->func);
677 lua_setfield(L, -2, l->name); 678 lua_setfield(L, -2, l->name);
678 } 679 }