Don't set a value twice (#1306)

This commit is contained in:
Julien Voisin
2023-08-19 12:28:19 +08:00
committed by takase1121
parent d06c9f401c
commit d86413cc30
+1 -1
View File
@@ -377,7 +377,7 @@ static int Lutf8_codepoint (lua_State *L) {
luaL_checkstack(L, n, "string slice too long"); luaL_checkstack(L, n, "string slice too long");
n = 0; /* count the number of returns */ n = 0; /* count the number of returns */
se = s + pose; /* string end */ se = s + pose; /* string end */
for (n = 0, s += posi - 1; s < se;) { for (s += posi - 1; s < se;) {
utfint code = 0; utfint code = 0;
s = utf8_safe_decode(L, s, &code); s = utf8_safe_decode(L, s, &code);
if (!lax && utf8_invalid(code)) if (!lax && utf8_invalid(code))