From 6444b7b5932682bced45fc8ec4409e360e1d9e7d Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Mon, 22 Aug 2022 15:24:50 +0200 Subject: [PATCH] fix config file parsing bug with signed char --- qescript.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qescript.c b/qescript.c index c330a11..1aa712a 100644 --- a/qescript.c +++ b/qescript.c @@ -67,7 +67,7 @@ enum { static const char ops2[] = "*= /= %= += -= <<= >>= &= ^= |= == != << >> <= >= ++ -- || && "; static const char ops1[] = "=<>?:|^&+-*/%,;.!~()[]{}"; -static const char precs[] = { +static const u8 precs[] = { '(', '[', '.', TOK_INC, TOK_DEC, 14, '*', '/', '%', 13, '+', '-', 12, @@ -136,7 +136,7 @@ static void qe_cfg_release(QEmacsDataSource *ds) { } static int qe_cfg_get_prec(int tok) { - char *p = strchr(precs, tok); + const u8 *p = memchr(precs, tok, sizeof precs); if (p) { while (*++p >= ' ') continue; @@ -1242,7 +1242,7 @@ static const CmdDef parser_commands[] = { #endif }; -static int parser_init(void) +static int parser_init(void) { { qe_register_cmd_table(parser_commands, countof(parser_commands), NULL); qe_register_completion(&symbol_completion);