summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-02-06 15:44:23 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-02-06 15:44:23 (GMT)
commit17b49653f33040bd6d6c6471e93c5a4b8140bb7a (patch)
tree073056c2ee13595a10ad143397901e5cbdfb5a44 /generic
parentd0a04da15e64d7bcf8fcec65ceae7c721c8c4ad2 (diff)
downloadtk-17b49653f33040bd6d6c6471e93c5a4b8140bb7a.zip
tk-17b49653f33040bd6d6c6471e93c5a4b8140bb7a.tar.gz
tk-17b49653f33040bd6d6c6471e93c5a4b8140bb7a.tar.bz2
[2b6778efe8] handle sscanf() EOF errors.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkEntry.c4
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