Mail Archives: djgpp-workers/1999/08/01/07:51:40
On Sat, 31 Jul 1999 pavenis AT lanet DOT lv wrote:
> #include <stdio.h>
>
> main()
> {
> char buf[64];
> char *p = buf, *q = NULL;
> sprintf(buf, "%p", p);
> sscanf(buf, "%p", &q);
> exit (p != q);
> }
That's because _doscan doesn't use 16 as conversion base with %p, and
_doprnt doesn't produce the leading 0x when passed %p as the format.
DJ, is it a good idea to have %p imply the base of 16 in doscan.c?
Since %p is non-ANSI, I guess we could do this if we document it, no?
FWIW, it seems that this problem was in doscan.c from day one.
- Raw text -