summaryrefslogtreecommitdiff
path: root/bin/stty
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-09-15 23:13:04 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-09-15 23:13:04 +0000
commit22e55e3d6d446c9035551a18480cde80856ddfe9 (patch)
tree7ed396e541a32640ee59494198781584a0c53d52 /bin/stty
parent940b14abb425d608a4f941c7873f0656ac64b452 (diff)
sprintf -> snprintf paranoia
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/print.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/stty/print.c b/bin/stty/print.c
index 8090d2a7817..1e1e6af1df7 100644
--- a/bin/stty/print.c
+++ b/bin/stty/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.4 1996/08/02 12:10:39 deraadt Exp $ */
+/* $OpenBSD: print.c,v 1.5 1996/09/15 23:13:03 millert Exp $ */
/* $NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.4 1996/08/02 12:10:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.5 1996/09/15 23:13:03 millert Exp $";
#endif
#endif /* not lint */
@@ -193,8 +193,10 @@ print(tp, wp, ldisc, fmt)
if (fmt != BSD && cc[p->sub] == p->def)
continue;
#define WD "%-8s"
- (void)sprintf(buf1 + cnt * 8, WD, p->name);
- (void)sprintf(buf2 + cnt * 8, WD, ccval(p, cc[p->sub]));
+ (void)snprintf(buf1 + cnt * 8, sizeof(buf1) - cnt * 8,
+ WD, p->name);
+ (void)snprintf(buf2 + cnt * 8, sizeof(buf2) - cnt * 8,
+ WD, ccval(p, cc[p->sub]));
if (++cnt == LINELENGTH / 8) {
cnt = 0;
(void)printf("%s\n", buf1);