From f82057be9e948704052132816745ea598ade0434 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 28 Dec 1997 05:03:33 +0000 Subject: [PATCH] Handle "%...p" as "%#...x" instead of "0x%...x". This is a quick fix for field widths being 2 larger than specified for "%p". Only printing of null pointers is "wrong" now (it is actually "right", but inconsistent with printf(3)). --- sys/kern/subr_prf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index f166162a54f7..34191afe4f1d 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 - * $Id: subr_prf.c,v 1.42 1997/09/02 20:05:51 bde Exp $ + * $Id: subr_prf.c,v 1.43 1997/10/12 20:23:58 phk Exp $ */ #include @@ -499,8 +499,7 @@ reswitch: switch (ch = (u_char)*fmt++) { case 'p': ul = (u_long)va_arg(ap, void *); base = 16; - PCHAR('0'); - PCHAR('x'); + sharpflag = 1; goto number; case 's': p = va_arg(ap, char *);