diff options
author | dgp <dgp@users.sourceforge.net> | 2015-02-06 15:46:23 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-02-06 15:46:23 (GMT) |
commit | 7db8158e3ce0e6274a1436e4f969e28fbe905d19 (patch) | |
tree | 3eeb8b3b0c163bd6e872915a355de94890bbf291 | |
parent | b84313bdb7b4e075d46e628a9ba72067874a7fd2 (diff) | |
parent | 17b49653f33040bd6d6c6471e93c5a4b8140bb7a (diff) | |
download | tk-7db8158e3ce0e6274a1436e4f969e28fbe905d19.zip tk-7db8158e3ce0e6274a1436e4f969e28fbe905d19.tar.gz tk-7db8158e3ce0e6274a1436e4f969e28fbe905d19.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 f68e1a3..3ad9acd 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1337,7 +1337,7 @@ ConfigureEntry( double dvalue; - if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { + if (sscanf(entryPtr->string, "%lf", &dvalue) <= 0) { /* Scan failure */ dvalue = sbPtr->fromValue; } else if (dvalue > sbPtr->toValue) { @@ -4254,7 +4254,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 |