Also fixes a crash reported by Hiltjo Posthuma <hiltjo at codemadness
dot org>, though in a different way than with the patch he sent.
OK florian@ bcallah@
-/* $OpenBSD: display.c,v 1.47 2015/04/03 22:10:29 bcallah Exp $ */
+/* $OpenBSD: display.c,v 1.48 2017/07/06 19:27:37 schwarze Exp $ */
/* This file is in the public domain. */
} else if (ISCTRL(c) != FALSE) {
vtpute('^');
vtpute(CCHR(c));
- } else {
+ } else if (isprint(c)) {
if (vtcol >= 0)
vp->v_text[vtcol] = c;
++vtcol;
+ } else {
+ char bf[5], *cp;
+
+ snprintf(bf, sizeof(bf), "\\%o", c);
+ for (cp = bf; *cp != '\0'; cp++)
+ vtpute(*cp);
}
}