diff options
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.61 2002/03/07 18:15:10 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.62 2002/03/20 12:54:08 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 | */ |
@@ -93,7 +93,7 @@ LUALIB_API const char *luaL_check_lstr (lua_State *L, int narg, size_t *len) { | |||
93 | 93 | ||
94 | 94 | ||
95 | LUALIB_API const char *luaL_opt_lstr (lua_State *L, int narg, const char *def, size_t *len) { | 95 | LUALIB_API const char *luaL_opt_lstr (lua_State *L, int narg, const char *def, size_t *len) { |
96 | if (lua_isnone(L, narg)) { | 96 | if (lua_isnoneornil(L, narg)) { |
97 | if (len) | 97 | if (len) |
98 | *len = (def ? strlen(def) : 0); | 98 | *len = (def ? strlen(def) : 0); |
99 | return def; | 99 | return def; |
@@ -111,7 +111,7 @@ LUALIB_API lua_Number luaL_check_number (lua_State *L, int narg) { | |||
111 | 111 | ||
112 | 112 | ||
113 | LUALIB_API lua_Number luaL_opt_number (lua_State *L, int narg, lua_Number def) { | 113 | LUALIB_API lua_Number luaL_opt_number (lua_State *L, int narg, lua_Number def) { |
114 | if (lua_isnone(L, narg)) return def; | 114 | if (lua_isnoneornil(L, narg)) return def; |
115 | else return luaL_check_number(L, narg); | 115 | else return luaL_check_number(L, narg); |
116 | } | 116 | } |
117 | 117 | ||