summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1998-06-12 12:09:13 +0000
committerDavid Leonard <d@cvs.openbsd.org>1998-06-12 12:09:13 +0000
commit61fb68eb1e5d26a9b6404da85320859cc45eb984 (patch)
treed5fab89d980391e7e4889c6428a0b6f4fed53ca5
parentcb172ab06589ddcab6574fac26bf9af0d0a3ae9c (diff)
fix potential bug where sprintf and %p would write to console
-rw-r--r--sys/lib/libsa/printf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/lib/libsa/printf.c b/sys/lib/libsa/printf.c
index bac8821290f..c43647a97d0 100644
--- a/sys/lib/libsa/printf.c
+++ b/sys/lib/libsa/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.12 1998/04/18 18:00:13 deraadt Exp $ */
+/* $OpenBSD: printf.c,v 1.13 1998/06/12 12:09:12 d Exp $ */
/* $NetBSD: printf.c,v 1.10 1996/11/30 04:19:21 gwr Exp $ */
/*-
@@ -206,8 +206,8 @@ reswitch: switch (ch = *fmt++) {
kprintn(put, ul, 10);
break;
case 'p':
- putchar('0');
- putchar('x');
+ put('0');
+ put('x');
lflag += sizeof(void *)==sizeof(u_long)? 1 : 0;
case 'x':
ul = lflag ?