www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/08/03/08:54:49

X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs
Date: Tue, 3 Aug 1999 10:51:38 +0300 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: DJ Delorie <dj AT delorie DOT com>, djgpp-workers AT delorie DOT com
Subject: Re: sscanf() format %p seems to be broken
In-Reply-To: <Pine.SUN.3.91.990803103805.1847G-100000@is>
Message-ID: <Pine.A41.4.05.9908031048470.27714-100000@ieva01.lanet.lv>
MIME-Version: 1.0
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


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;
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019