summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2008-10-05 11:34:45 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2008-10-05 11:34:45 (GMT)
commit7948114a00cbb067d9fd922efbce1010bec9813e (patch)
tree3902ed875b423c3eb9023c8bdd524105846cc013 /generic/tkEntry.c
parent125c9fa123dd9ac104d0e3c4cf0908060f39b0be (diff)
downloadtk-7948114a00cbb067d9fd922efbce1010bec9813e.zip
tk-7948114a00cbb067d9fd922efbce1010bec9813e.tar.gz
tk-7948114a00cbb067d9fd922efbce1010bec9813e.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]),