From b3937b0380b890349ca1e5f6f06fdfdf97c28655 Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Thu, 5 Jan 2023 21:48:49 +0100 Subject: [PATCH] Don't set a value twice (#1306) --- src/api/utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/utf8.c b/src/api/utf8.c index 643cb2cc..b23b4cfc 100644 --- a/src/api/utf8.c +++ b/src/api/utf8.c @@ -377,7 +377,7 @@ static int Lutf8_codepoint (lua_State *L) { luaL_checkstack(L, n, "string slice too long"); n = 0; /* count the number of returns */ se = s + pose; /* string end */ - for (n = 0, s += posi - 1; s < se;) { + for (s += posi - 1; s < se;) { utfint code = 0; s = utf8_safe_decode(L, s, &code); if (!lax && utf8_invalid(code))