Merge pull request #3 from Oichkatzelesfrettschen/codex/find-and-fix-bug-in-important-code

Fix hex escape fallback in seq
This commit is contained in:
Eirikr Hinngart 2025-05-17 00:57:06 -07:00 committed by GitHub
commit 26b1f8dbd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -350,8 +350,13 @@ unescape(char *orig)
*orig = c;
--cp;
continue;
case 'x': /* hexidecimal number */
case 'x': /* hexadecimal number */
cp++; /* skip 'x' */
if (!isxdigit((unsigned char)*cp)) {
--cp;
/* keep the backslash, treat 'x' literally */
continue;
}
for (i = 0, c = 0;
isxdigit((unsigned char)*cp) && i < 2;
i++, cp++) {