Peter Oberndorfer <kumbayo84@arcor.de>

- Implement %p for scanf.

svn path=/trunk/; revision=34293
This commit is contained in:
Aleksey Bragin 2008-07-04 12:39:43 +00:00
parent b33ec42e10
commit c2eaa10731

View file

@ -149,6 +149,8 @@ _FUNCTION_ {
}
/* read type */
switch(*format) {
case 'p':
case 'P': /* pointer. */
case 'x':
case 'X': /* hexadecimal integer. */
base = 16;
@ -179,7 +181,7 @@ _FUNCTION_ {
if (width>0) width--;
}
/* look for leading indication of base */
if (width!=0 && nch == '0') {
if (width!=0 && nch == '0' && *format != 'p' && *format != 'P') {
nch = _GETC_(file);
if (width>0) width--;
seendigit=1;