diff options
author | dgp@users.sourceforge.net <dgp> | 2015-02-06 15:44:23 (GMT) |
---|---|---|
committer | dgp@users.sourceforge.net <dgp> | 2015-02-06 15:44:23 (GMT) |
commit | c8861abdbb178764cc393e7c503fdbe9152f63b9 (patch) | |
tree | a60fdd4ba62b1356603ecba4e6b79e189335860a | |
parent | 890fcb88d75ba32a07de9179a40631d6a2209dd7 (diff) | |
download | tk-c8861abdbb178764cc393e7c503fdbe9152f63b9.zip tk-c8861abdbb178764cc393e7c503fdbe9152f63b9.tar.gz tk-c8861abdbb178764cc393e7c503fdbe9152f63b9.tar.bz2 |
[2b6778efe8] handle sscanf() EOF errors.
-rw-r--r-- | generic/tkEntry.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 816b7fa..6683cdc 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1330,7 +1330,7 @@ ConfigureEntry( double dvalue; - if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { + if (sscanf(entryPtr->string, "%lf", &dvalue) <= 0) { /* Scan failure */ dvalue = sbPtr->fromValue; } else { @@ -4231,7 +4231,7 @@ SpinboxInvoke( } else if (!DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)) { double dvalue; - if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { + if (sscanf(entryPtr->string, "%lf", &dvalue) <= 0) { /* * If the string doesn't scan as a double value, just * use the -from value |