mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 00:33:57 +00:00
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:
parent
cdf03d9cdf
commit
12d17f6512
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3174
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue