Added a %p to printf & friends, same thing as 0x%08x but more with the

potiential to make a warning from gcc more useful.
This commit is contained in:
Poul-Henning Kamp 1994-09-28 19:22:32 +00:00
parent cdf03d9cdf
commit 12d17f6512
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3174

View file

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
* $Id: subr_prf.c,v 1.4 1994/08/13 14:21:51 davidg Exp $
* $Id: subr_prf.c,v 1.5 1994/08/27 16:14:27 davidg Exp $
*/
#include <sys/param.h>
@ -448,6 +448,13 @@ reswitch: switch (ch = *(u_char *)fmt++) {
ul = lflag ? va_arg(ap, u_long) : va_arg(ap, u_int);
base = 10;
goto number;
case 'p':
ul = (u_long) va_arg(ap, void *);
width=8;
base=16;
putchar('0',flags,tp);
putchar('x',flags,tp);
goto number;
case 'x':
ul = lflag ? va_arg(ap, u_long) : va_arg(ap, u_int);
base = 16;