summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-10-05 11:34:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-10-05 11:34:45 (GMT)
commit199d4675fda94dffe00bafa804ea9f5e38f0891b (patch)
tree3902ed875b423c3eb9023c8bdd524105846cc013 /generic/tkEntry.c
parent8a44d010fe0fe2f1b6787480556519e67e5458f2 (diff)
downloadtk-199d4675fda94dffe00bafa804ea9f5e38f0891b.zip
tk-199d4675fda94dffe00bafa804ea9f5e38f0891b.tar.gz
tk-199d4675fda94dffe00bafa804ea9f5e38f0891b.tar.bz2
Backport of fix for [Bug 2112563]
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 62b0806..3ba727f 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkEntry.c,v 1.47 2007/12/13 15:24:14 dgp Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.47.2.1 2008/10/05 11:34:46 dkf Exp $
*/
#include "tkInt.h"
@@ -926,11 +926,13 @@ EntryWidgetObjCmd(
if (objc == 2) {
double first, last;
- char buf[TCL_DOUBLE_SPACE * 2];
+ char buf[TCL_DOUBLE_SPACE];
EntryVisibleRange(entryPtr, &first, &last);
- sprintf(buf, "%g %g", first, last);
+ Tcl_PrintDouble(NULL, first, buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_PrintDouble(NULL, last, buf);
+ Tcl_AppendResult(interp, " ", buf, NULL);
goto done;
} else if (objc == 3) {
if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
@@ -2928,7 +2930,7 @@ static void
EntryUpdateScrollbar(
Entry *entryPtr) /* Information about widget. */
{
- char args[TCL_DOUBLE_SPACE * 2];
+ char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE];
int code;
double first, last;
Tcl_Interp *interp;
@@ -2940,8 +2942,10 @@ EntryUpdateScrollbar(
interp = entryPtr->interp;
Tcl_Preserve((ClientData) interp);
EntryVisibleRange(entryPtr, &first, &last);
- sprintf(args, " %g %g", first, last);
- code = Tcl_VarEval(interp, entryPtr->scrollCmd, args, NULL);
+ Tcl_PrintDouble(NULL, first, firstStr);
+ Tcl_PrintDouble(NULL, last, lastStr);
+ code = Tcl_VarEval(interp, entryPtr->scrollCmd, firstStr, " ", lastStr,
+ NULL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (horizontal scrolling command executed by ");
@@ -4041,11 +4045,13 @@ SpinboxWidgetObjCmd(
if (objc == 2) {
double first, last;
- char buf[TCL_DOUBLE_SPACE * 2];
+ char buf[TCL_DOUBLE_SPACE];
EntryVisibleRange(entryPtr, &first, &last);
- sprintf(buf, "%g %g", first, last);
+ Tcl_PrintDouble(NULL, first, buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_PrintDouble(NULL, last, buf);
+ Tcl_AppendResult(interp, " ", buf, NULL);
goto done;
} else if (objc == 3) {
if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),