From 4a799d6586061e587b055de5cab167204d488b50 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 14 May 1998 09:58:28 +0000 Subject: better buf oflow protection --- lib/libcurses/lib_mvcur.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libcurses') diff --git a/lib/libcurses/lib_mvcur.c b/lib/libcurses/lib_mvcur.c index 8979d65b4ed..7fdee4eccfe 100644 --- a/lib/libcurses/lib_mvcur.c +++ b/lib/libcurses/lib_mvcur.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mvcur.c,v 1.7 1998/05/14 09:48:49 deraadt Exp $ */ +/* $OpenBSD: lib_mvcur.c,v 1.8 1998/05/14 09:58:18 deraadt Exp $ */ /*************************************************************************** @@ -971,8 +971,8 @@ int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) char buf[BUFSIZ], capname[BUFSIZ]; char tparsebuf[20], tparsebuf[20]; - snprintf(tparsebuf, sizeof tparsebuf, "l %%%ds", sizeof tname); - snprintf(cparsebuf, sizeof cparsebuf, "d %%%ds", sizeof capname); + snprintf(tparsebuf, sizeof tparsebuf, "l %%%ds", sizeof tname-1); + snprintf(cparsebuf, sizeof cparsebuf, "d %%%ds", sizeof capname-1); (void) fputs("> ", stdout); (void) fgets(buf, sizeof(buf), stdin); -- cgit v1.2.3