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