diff options
author | dgp <dgp@users.sourceforge.net> | 2015-02-06 15:44:23 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-02-06 15:44:23 (GMT) |
commit | 17b49653f33040bd6d6c6471e93c5a4b8140bb7a (patch) | |
tree | 073056c2ee13595a10ad143397901e5cbdfb5a44 /generic/tkEntry.c | |
parent | d0a04da15e64d7bcf8fcec65ceae7c721c8c4ad2 (diff) | |
download | tk-17b49653f33040bd6d6c6471e93c5a4b8140bb7a.zip tk-17b49653f33040bd6d6c6471e93c5a4b8140bb7a.tar.gz tk-17b49653f33040bd6d6c6471e93c5a4b8140bb7a.tar.bz2 |
[2b6778efe8] handle sscanf() EOF errors.
Diffstat (limited to 'generic/tkEntry.c')
-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 |