diff options
Diffstat (limited to 'lutf8lib.c')
| -rw-r--r-- | lutf8lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -103,7 +103,7 @@ static int utflen (lua_State *L) { | |||
| 103 | lua_pushinteger(L, posi + 1); /* ... and current position */ | 103 | lua_pushinteger(L, posi + 1); /* ... and current position */ |
| 104 | return 2; | 104 | return 2; |
| 105 | } | 105 | } |
| 106 | posi = s1 - s; | 106 | posi = ct_diff2S(s1 - s); |
| 107 | n++; | 107 | n++; |
| 108 | } | 108 | } |
| 109 | lua_pushinteger(L, n); | 109 | lua_pushinteger(L, n); |
| @@ -137,7 +137,7 @@ static int codepoint (lua_State *L) { | |||
| 137 | s = utf8_decode(s, &code, !lax); | 137 | s = utf8_decode(s, &code, !lax); |
| 138 | if (s == NULL) | 138 | if (s == NULL) |
| 139 | return luaL_error(L, MSGInvalid); | 139 | return luaL_error(L, MSGInvalid); |
| 140 | lua_pushinteger(L, code); | 140 | lua_pushinteger(L, l_castU2S(code)); |
| 141 | n++; | 141 | n++; |
| 142 | } | 142 | } |
| 143 | return n; | 143 | return n; |
| @@ -240,7 +240,7 @@ static int iter_aux (lua_State *L, int strict) { | |||
| 240 | if (next == NULL || iscontp(next)) | 240 | if (next == NULL || iscontp(next)) |
| 241 | return luaL_error(L, MSGInvalid); | 241 | return luaL_error(L, MSGInvalid); |
| 242 | lua_pushinteger(L, l_castU2S(n + 1)); | 242 | lua_pushinteger(L, l_castU2S(n + 1)); |
| 243 | lua_pushinteger(L, code); | 243 | lua_pushinteger(L, l_castU2S(code)); |
| 244 | return 2; | 244 | return 2; |
| 245 | } | 245 | } |
| 246 | } | 246 | } |
