blob: a932e66169ab886a92e6c888777e4c8f7b61b442 [file] [log] [blame]
diff --git a/ncurses/tinfo/captoinfo.c b/ncurses/tinfo/captoinfo.c
index a0da44d..83c5216 100644
--- a/ncurses/tinfo/captoinfo.c
+++ b/ncurses/tinfo/captoinfo.c
@@ -207,8 +207,13 @@ cvtchar(register const char *sp)
}
break;
case '^':
- c = (unsigned char) (*++sp & 0x1f);
len = 2;
+ c = (unsigned char) (*++sp);
+ if (c == '\0') {
+ len = 1;
+ } else {
+ c &= 0x1f;
+ }
break;
default:
c = (unsigned char) (*sp);