summaryrefslogtreecommitdiff
path: root/lib/libcurses
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-14 09:58:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-14 09:58:28 +0000
commit4a799d6586061e587b055de5cab167204d488b50 (patch)
treec1407d4cc6854f5070229059451c85ef24ecca43 /lib/libcurses
parent39fc8dc6e08faa4f43c53ae7583495a39361f008 (diff)
better buf oflow protection
Diffstat (limited to 'lib/libcurses')
-rw-r--r--lib/libcurses/lib_mvcur.c6
1 files changed, 3 insertions, 3 deletions
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);