This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Handle 0 result from sscanf when parsing fp values.
- From: Andreas Schwab <schwab at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 17 Aug 2010 10:18:33 +0200
- Subject: Re: [patch] Handle 0 result from sscanf when parsing fp values.
- References: <20100817003114.087EA84B8F@ruffy.mtv.corp.google.com>
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."