aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-08 02:13:16 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-08 02:13:16 +0100
commitac444ace1909e93a1fcdd25e25edf644756eb798 (patch)
treed8226f5dad3bf18dc814bbf95852f68d26f44809 /src/mds-kbdc
parentmds-kbdc: bug fix (diff)
downloadmds-ac444ace1909e93a1fcdd25e25edf644756eb798.tar.gz
mds-ac444ace1909e93a1fcdd25e25edf644756eb798.tar.bz2
mds-ac444ace1909e93a1fcdd25e25edf644756eb798.tar.xz
mds-kbdc: compile-keyboard: regression
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-kbdc')
-rw-r--r--src/mds-kbdc/compile-layout.c13
1 files changed, 9 insertions, 4 deletions
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 \
{ \