diff options
Diffstat (limited to 'lutf8lib.c')
-rw-r--r-- | lutf8lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -103,7 +103,7 @@ static int utflen (lua_State *L) { | |||
103 | while (posi <= posj) { | 103 | while (posi <= posj) { |
104 | const char *s1 = utf8_decode(s + posi, NULL, !lax); | 104 | const char *s1 = utf8_decode(s + posi, NULL, !lax); |
105 | if (s1 == NULL) { /* conversion error? */ | 105 | if (s1 == NULL) { /* conversion error? */ |
106 | lua_pushnil(L); /* return nil ... */ | 106 | luaL_pushfail(L); /* return fail ... */ |
107 | lua_pushinteger(L, posi + 1); /* ... and current position */ | 107 | lua_pushinteger(L, posi + 1); /* ... and current position */ |
108 | return 2; | 108 | return 2; |
109 | } | 109 | } |
@@ -216,7 +216,7 @@ static int byteoffset (lua_State *L) { | |||
216 | if (n == 0) /* did it find given character? */ | 216 | if (n == 0) /* did it find given character? */ |
217 | lua_pushinteger(L, posi + 1); | 217 | lua_pushinteger(L, posi + 1); |
218 | else /* no such character */ | 218 | else /* no such character */ |
219 | lua_pushnil(L); | 219 | luaL_pushfail(L); |
220 | return 1; | 220 | return 1; |
221 | } | 221 | } |
222 | 222 | ||