From 513e0ac59bf1b2d381cac2202b45236e7f751c3e Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Mon, 23 Nov 2009 23:59:46 +0000 Subject: Bugfix to termkey_format_key() in FORMAT_CARETCTRL case when formatting Ctrl-Letter --- termkey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/termkey.c b/termkey.c index da4397d..7a90684 100644 --- a/termkey.c +++ b/termkey.c @@ -871,14 +871,14 @@ size_t termkey_snprint_key(TermKey *tk, char *buffer, size_t len, TermKeyKey *ke if(codepoint >= 'a' && codepoint <= 'z') { l = snprintf(buffer + pos, len - pos, wrapbracket ? "<^%c>" : "^%c", (char)codepoint - 0x20); if(l <= 0) return pos; - pos += len; + pos += l; return pos; } else if((codepoint >= '@' && codepoint < 'A') || (codepoint > 'Z' && codepoint <= '_')) { l = snprintf(buffer + pos, len - pos, wrapbracket ? "<^%c>" : "^%c", (char)codepoint); if(l <= 0) return pos; - pos += len; + pos += l; return pos; } } -- cgit v1.2.3-70-g09d2