From c6821947f1bc4e30d439b1d5f41334135bd7bcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloi=20D=C3=A9molis?= <43861898+Wonshtrum@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:34:47 +0200 Subject: [PATCH] Fix char literal parsing When creating a char literal token, its end pointed one character after its actual end. --- stb_c_lexer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stb_c_lexer.h b/stb_c_lexer.h index fd42f1c37..90ed5b55c 100644 --- a/stb_c_lexer.h +++ b/stb_c_lexer.h @@ -39,6 +39,7 @@ // Arpad Goretity (bugfix) // Alan Hickman (hex floats) // github:mundusnine (bugfix) +// Wonshtrum (bugfix) // // LICENSE // @@ -672,7 +673,7 @@ int stb_c_lexer_get_token(stb_lexer *lexer) return stb__clex_token(lexer, CLEX_parse_error, start,start); if (p == lexer->eof || *p != '\'') return stb__clex_token(lexer, CLEX_parse_error, start,p); - return stb__clex_token(lexer, CLEX_charlit, start, p+1); + return stb__clex_token(lexer, CLEX_charlit, start, p); }) goto single_char;