Mail Archives: djgpp-workers/1999/08/03/08:37:40
On Mon, 2 Aug 1999, DJ Delorie wrote:
> > DJ, is it a good idea to have %p imply the base of 16 in doscan.c?
>
> The only rule is that what printf prints for %p is what scanf should
> expect for %p. It could be in pig-latin as long as it worked.
> Borland, for example, prints 0000:0000 in some models.
I believe the patch below solves the problem. Andris, could you
please see if it helps to pass the test where you discovered this
problem?
*** src/libc/ansi/stdio/doscan.c~3 Wed Jul 28 18:08:52 1999
--- src/libc/ansi/stdio/doscan.c Mon Aug 2 22:31:44 1999
*************** _innum(int **ptr, int type, int len, int
*** 195,201 ****
base = 10;
if (type=='o')
base = 8;
! else if (type=='x')
base = 16;
np = numbuf;
expseen = 0;
--- 195,201 ----
base = 10;
if (type=='o')
base = 8;
! else if (type=='x'||type=='p')
base = 16;
np = numbuf;
expseen = 0;
- Raw text -