From 8917d7405922da49e438f726f5d537d95615e8eb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 7 Dec 2014 16:13:52 +0100 Subject: mds-kbdc: compile-layout: fix bug in parsing escapes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/compile-layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mds-kbdc') diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c index 2d7ed04..056191b 100644 --- a/src/mds-kbdc/compile-layout.c +++ b/src/mds-kbdc/compile-layout.c @@ -653,7 +653,7 @@ static char32_t* parse_escape(mds_kbdc_tree_t* restrict tree, const char* restri *escape = 16; else if (R('1', '9')) /* Variable dereference. */ - *escape = 10; + *escape = 10, have = 1, numbuf = (uintmax_t)(c - '0'); else if ((c == '_') || R('a', 'z') || R('A', 'Z')) /* Function call. */ *escape = 100; @@ -666,7 +666,7 @@ static char32_t* parse_escape(mds_kbdc_tree_t* restrict tree, const char* restri /* Function call. */ return parse_function_call(tree, raw_, lineoff, escape, end); /* Octal or hexadecimal representation, or variable dereference. */ - for (; (c = *raw++) && (c != '.'); have = 1) + for (; c = *raw++, c != '.'; have = 1) if (CR(*escape == 8, '0', '7')) numbuf = 8 * numbuf + (c & 15); else if (CR(*escape == 16, '0', '9')) numbuf = 16 * numbuf + (c & 15); else if (CR(*escape == 16, 'a', 'f')) numbuf = 16 * numbuf + (c & 15) + 9; -- cgit v1.2.3-70-g09d2