From 3cdd49c94a8feed94853ba3a6adaa556fb34fd8d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 14 Jan 2025 16:24:46 -0300 Subject: Fixed conversion warnings from clang Plus some other details. (Option '-Wuninitialized' was removed from the makefile because it is already enabled by -Wall.) --- llex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 3518f0da..1c4227ca 100644 --- a/llex.c +++ b/llex.c @@ -349,9 +349,14 @@ static int readhexaesc (LexState *ls) { } +/* +** When reading a UTF-8 escape sequence, save everything to the buffer +** for error reporting in case of errors; 'i' counts the number of +** saved characters, so that they can be removed if case of success. +*/ static unsigned long readutf8esc (LexState *ls) { unsigned long r; - int i = 4; /* chars to be removed: '\', 'u', '{', and first digit */ + int i = 4; /* number of chars to be removed: start with #"\u{X" */ save_and_next(ls); /* skip 'u' */ esccheck(ls, ls->current == '{', "missing '{'"); r = cast_ulong(gethexa(ls)); /* must have at least one digit */ -- cgit v1.2.3-55-g6feb