From b400b6bbdc526f5de357cb2657d79ea0343870bc Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 6 Jan 2026 09:26:13 +0900 Subject: fix: for loop with multiple variable declarations In this C code, for (T v = expr1, u = expr2; ...; ...) { ... } the "expr2" was silently discarded before. --- src/tokenize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/tokenize.c') diff --git a/src/tokenize.c b/src/tokenize.c index 864da85..1e7a8df 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -438,8 +438,7 @@ TokenArray* convert_pp_tokens_to_tokens(TokenArray* pp_tokens) { size_t len = strlen(pp_tok->value.string); char* buf = calloc(len + 1, sizeof(char)); - size_t j = 0; - for (size_t i = 0; i < len; i++, j++) { + for (size_t i = 0, j = 0; i < len; i++, j++) { if (pp_tok->value.string[i] == '\\' && pp_tok->value.string[i + 1] == 'e') { // \e is not a part of Standard C, but commonly supported. buf[j] = 033; -- cgit v1.2.3-70-g09d2