Date: Sun, 1 Aug 1999 11:49:06 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: pavenis AT lanet DOT lv cc: djgpp-workers AT delorie DOT com, DJ Delorie Subject: Re: sscanf() format %p seems to be broken In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 31 Jul 1999 pavenis AT lanet DOT lv wrote: > #include > > 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.