diff --git a/src/modal.c b/src/modal.c index 5447fde..91f31c3 100644 --- a/src/modal.c +++ b/src/modal.c @@ -145,11 +145,10 @@ write_reg(char r, char *reg) char c, *cap = walk(reg); if(*reg == '(' && reg[1] != ')') { /* tuple */ reg++; - while(reg < cap) { + while(reg < cap - 1) { while((c = *reg) && !spacer(c)) *dst_++ = c, reg++; - *dst_++ = ' '; - *dst_++ = '(', reg++, depth++; + *dst_++ = ' ', *dst_++ = '(', reg++, depth++; } } else /* token */ while((c = *reg++) && !spacer(c))