Date: Tue, 3 Aug 1999 10:38:42 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: DJ Delorie cc: pavenis AT lanet DOT lv, djgpp-workers AT delorie DOT com Subject: Re: sscanf() format %p seems to be broken In-Reply-To: <199908021430.KAA01030@envy.delorie.com> 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 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;