diff options
-rw-r--r-- | lutf8lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lutf8lib.c,v 1.2 2014/02/06 20:03:24 roberto Exp roberto $ | 2 | ** $Id: lutf8lib.c,v 1.3 2014/03/20 14:11:00 roberto Exp roberto $ |
3 | ** Standard library for UTF-8 manipulation | 3 | ** Standard library for UTF-8 manipulation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -108,7 +108,7 @@ static int codepoint (lua_State *L) { | |||
108 | int code; | 108 | int code; |
109 | s = utf8_decode(s, &code); | 109 | s = utf8_decode(s, &code); |
110 | if (s == NULL) | 110 | if (s == NULL) |
111 | luaL_error(L, "invalid UTF-8 code"); | 111 | return luaL_error(L, "invalid UTF-8 code"); |
112 | lua_pushinteger(L, code); | 112 | lua_pushinteger(L, code); |
113 | n++; | 113 | n++; |
114 | } | 114 | } |
@@ -200,7 +200,7 @@ static int iter_aux (lua_State *L) { | |||
200 | int code; | 200 | int code; |
201 | const char *next = utf8_decode(s + n, &code); | 201 | const char *next = utf8_decode(s + n, &code); |
202 | if (next == NULL || iscont(next)) | 202 | if (next == NULL || iscont(next)) |
203 | luaL_error(L, "invalid UTF-8 code"); | 203 | return luaL_error(L, "invalid UTF-8 code"); |
204 | lua_pushinteger(L, n + 1); | 204 | lua_pushinteger(L, n + 1); |
205 | lua_pushinteger(L, code); | 205 | lua_pushinteger(L, code); |
206 | return 2; | 206 | return 2; |