delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/02/14:05:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Wed, 2 Jun 2004 14:04:33 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
cc: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
Subject: Bug in scanf &Co (Was Re: Error message from antiword since upgrade to cygwin 1.5.10)
In-Reply-To: <Pine.GSO.4.58.0406021327090.18478@slinky.cs.nyu.edu>
Message-ID: <Pine.GSO.4.58.0406021357430.24651@slinky.cs.nyu.edu>
References: <F76C9B2DA2FC4C4CA0A18E288BBCBCF70821799F AT nihexchange24 DOT nih DOT gov> <123-1790318362 DOT 20040602140951 AT familiehaase DOT de> <Pine DOT GSO DOT 4 DOT 58 DOT 0406020949510 DOT 18478 AT slinky DOT cs DOT nyu DOT edu> <32-1775580380 DOT 20040602181529 AT familiehaase DOT de> <Pine DOT GSO DOT 4 DOT 58 DOT 0406021327090 DOT 18478 AT slinky DOT cs DOT nyu DOT edu>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

---559023410-1903590565-1086197614=:18478
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine DOT GSO DOT 4 DOT 58 DOT 0406021357432 DOT 24651 AT slinky DOT cs DOT nyu DOT edu>

On Wed, 2 Jun 2004, Igor Pechtchanski wrote:

> On Wed, 2 Jun 2004, Gerrit P. Haase wrote:
>
> [snip]
> > Everything works ok with cygwin-1.5.9.  I'll try to recompile with
> > 1.5.10 later, maybe that helps...
> >
> > Gerrit
>
> Try the attached patch.  FWIW, it seems like there's a bug here, but
> sscanf used to mask it.  Was there a change in the sscanf implementation
> since 1.5.9?
>         Igor

Never mind.  This is a bug in the newlib scanf family implementation
(actually, in __svfscanf_r in libc/stdio/vfscanf.c) that causes it to read
strings of the form 0x0+ incorrectly.  Attached is a testcase that
demonstrates the bug.  I suspect the following change:

2004-04-21  J"orn Rennecke <joern DOT rennecke AT superh DOT com>

        * libc/stdio/vfscanf.c (NNZDIGITS): New define.
        (__svfscanf_r): In integer conversions, leave out leading zeroes
        which are not part of a base prefix.
        Keep track of width truncation to fit into buf, not counting left-out
        zeroes against width till the truncation has been compensated for.

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton
---559023410-1903590565-1086197614=:18478
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="scanfbug.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine DOT GSO DOT 4 DOT 58 DOT 0406021404330 DOT 24651 AT slinky DOT cs DOT nyu DOT edu>
Content-Description: 
Content-Disposition: attachment; filename="scanfbug.c"

I2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPHN0ZGlvLmg+DQoNCmlu
dCBtYWluKGNoYXIgYWMsIGNoYXIgKmF2W10pIHsNCiAgY29uc3QgY2hhciAq
c3RyMSA9ICIweDEgMHgwIDB4MyI7DQogIGNvbnN0IGNoYXIgKnN0cjIgPSAi
MHgxIDB4MiAweDMiOw0KICB1bnNpZ25lZCBpbnQgaSxqLGs7DQogIHNzY2Fu
ZihzdHIxLCAiJXggJXggJXgiLCAmaSwgJmosICZrKTsNCiAgcHJpbnRmKCJW
YWx1ZXMgYXJlOiAleCAleCAleFxuIiwgaSwgaiwgayk7DQogIHNzY2FuZihz
dHIyLCAiJXggJXggJXgiLCAmaSwgJmosICZrKTsNCiAgcHJpbnRmKCJWYWx1
ZXMgYXJlOiAleCAleCAleFxuIiwgaSwgaiwgayk7DQp9DQoNCg==


---559023410-1903590565-1086197614=:18478
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
---559023410-1903590565-1086197614=:18478--

- Raw text -


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