delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/04/13:51:27

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
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: sscanf problem
Date: Mon, 4 Apr 2005 18:51:00 +0100
MIME-Version: 1.0
In-Reply-To: <42518ABD.6030107@yale.edu>
Message-ID: <SERRANOBPXzCZZuozJ700000037@SERRANO.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 04 Apr 2005 17:51:21.0835 (UTC) FILETIME=[E982DBB0:01C5393E]

----Original Message----
>From: Michael Hines
>Sent: 04 April 2005 19:43

> The following program prints
> i=1 x=0
> instead of
> i=0 x=10
> when using the latest version of cygwin1.dll.
> 
> 
> #include <stdio.h>
> int main() {
>          int i;
>          double x;
>          x = 10;
>          i = sscanf("n", "%lf", &x);
>          printf("i=%d x=%g\n", i, x);
>          return 0;
> }
> 
> 
> -Michael Hines


  Heh, the interminable newlib-sscanf-bug strikes again!  It's mis-parsing
the n as being the first letter of 'nan', which is a valid input to %f.  CV
sent a patch upstream to the newlib maintainers last week but I guess it
hasn't made it into the source yet.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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

- Raw text -


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