From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12315 invoked by alias); 17 Aug 2010 08:18:46 -0000 Received: (qmail 12303 invoked by uid 22791); 17 Aug 2010 08:18:45 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Aug 2010 08:18:40 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7H8IZel005675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Aug 2010 04:18:35 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7H8IXtc017521; Tue, 17 Aug 2010 04:18:34 -0400 From: Andreas Schwab To: dje@google.com (Doug Evans) Cc: gdb-patches@sourceware.org Subject: Re: [patch] Handle 0 result from sscanf when parsing fp values. References: <20100817003114.087EA84B8F@ruffy.mtv.corp.google.com> X-Yow: Finally, Zippy drives his 1958 RAMBLER METROPOLITAN into the faculty dining room. Date: Tue, 17 Aug 2010 08:18:00 -0000 In-Reply-To: <20100817003114.087EA84B8F@ruffy.mtv.corp.google.com> (Doug Evans's message of "Mon, 16 Aug 2010 17:31:13 -0700 (PDT)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00255.txt.bz2 dje@google.com (Doug Evans) writes: > Index: objc-exp.y > =================================================================== > RCS file: /cvs/src/src/gdb/objc-exp.y,v > retrieving revision 1.38 > diff -u -p -u -p -r1.38 objc-exp.y > --- objc-exp.y 5 Mar 2010 20:18:14 -0000 1.38 > +++ objc-exp.y 17 Aug 2010 00:17:29 -0000 > @@ -1016,8 +1016,9 @@ parse_number (p, len, parsed_float, puti > > /* It's a float since it contains a point or an exponent. */ > > - sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c", > - &putithere->typed_val_float.dval, &c); > + if (sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c", > + &putithere->typed_val_float.dval, &c) != 1) Shouldn't that be "< 1" since there can be two conversions? Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."