diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.206 2014/04/29 18:14:16 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.207 2014/04/30 16:48:44 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -333,13 +333,11 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { | |||
333 | } | 333 | } |
334 | 334 | ||
335 | 335 | ||
336 | LUA_API int lua_strtonum (lua_State *L, const char *s, size_t len) { | 336 | LUA_API size_t lua_strtonum (lua_State *L, const char *s) { |
337 | if (!luaO_str2num(s, len, L->top)) | 337 | size_t sz = luaO_str2num(s, L->top); |
338 | return 0; /* conversion failed */ | 338 | if (sz != 0) |
339 | else { | ||
340 | api_incr_top(L); | 339 | api_incr_top(L); |
341 | return 1; | 340 | return sz; |
342 | } | ||
343 | } | 341 | } |
344 | 342 | ||
345 | 343 | ||