From: nicm Date: Mon, 9 Jan 2023 07:48:12 +0000 (+0000) Subject: Correct length of replies to primary and secondary DAs so as not to send X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c015791f1417b4bc735cc42878265fdb6fa99306;p=openbsd Correct length of replies to primary and secondary DAs so as not to send a stray trailing NUL byte. From Crystal Kolipe. ok deraadt miod --- diff --git a/sys/dev/wscons/wsemul_vt100_subr.c b/sys/dev/wscons/wsemul_vt100_subr.c index 963dcc2b54a..f0676f6b8c4 100644 --- a/sys/dev/wscons/wsemul_vt100_subr.c +++ b/sys/dev/wscons/wsemul_vt100_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100_subr.c,v 1.24 2020/05/25 09:55:49 jsg Exp $ */ +/* $OpenBSD: wsemul_vt100_subr.c,v 1.25 2023/01/09 07:48:12 nicm Exp $ */ /* $NetBSD: wsemul_vt100_subr.c,v 1.7 2000/04/28 21:56:16 mycroft Exp $ */ /* @@ -231,7 +231,7 @@ wsemul_vt100_handle_csi(struct wsemul_vt100_emuldata *edp, switch (A3(edp->modif1, edp->modif2, c)) { case A3('>', '\0', 'c'): /* DA secondary */ wsdisplay_emulinput(edp->cbcookie, WSEMUL_VT_ID2, - sizeof(WSEMUL_VT_ID2)); + sizeof(WSEMUL_VT_ID2) - 1); break; case A3('\0', '\0', 'J'): /* ED selective erase in display */ @@ -510,7 +510,7 @@ wsemul_vt100_handle_csi(struct wsemul_vt100_emuldata *edp, case 'c': /* DA primary */ if (ARG(0) == 0) wsdisplay_emulinput(edp->cbcookie, WSEMUL_VT_ID1, - sizeof(WSEMUL_VT_ID1)); + sizeof(WSEMUL_VT_ID1) - 1); break; case 'g': /* TBC */ if (edp->tabs != NULL)