X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs Date: Tue, 3 Aug 1999 10:51:38 +0300 (WET) From: Andris Pavenis To: Eli Zaretskii cc: DJ Delorie , djgpp-workers AT delorie DOT com 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 Thanks. Now test is Ok. However I don't think it's so bad I have to rebuild gcc-2.95 for DJGPP unless there will be another reason. Andris On Tue, 3 Aug 1999, Eli Zaretskii wrote: > > 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; >