From ac444ace1909e93a1fcdd25e25edf644756eb798 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 8 Dec 2014 02:13:16 +0100 Subject: mds-kbdc: compile-keyboard: regression 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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mds-kbdc') diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c index 2dae093..b8b5cfe 100644 --- a/src/mds-kbdc/compile-layout.c +++ b/src/mds-kbdc/compile-layout.c @@ -735,10 +735,15 @@ static char32_t* parse_quoted_string(mds_kbdc_tree_t* restrict tree, const char* memcpy(rc + rc_ptr, subrc, n * sizeof(char32_t)), rc_ptr += n; \ free(subrc), subrc = NULL #define STORE \ - GROW_BUF; \ - buf[buf_ptr] = '\0', buf_ptr = 0; \ - fail_if (subrc = string_decode(buf), subrc == NULL); \ - COPY + if (buf_ptr) \ + do \ + { \ + GROW_BUF; \ + buf[buf_ptr] = '\0', buf_ptr = 0; \ + fail_if (subrc = string_decode(buf), subrc == NULL); \ + COPY; \ + } \ + while (0) #define CHAR_ERROR(...) \ do \ { \ -- cgit v1.2.3-70-g09d2