summaryrefslogtreecommitdiffstats
path: root/generic/tkScrollbar.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-10-03 13:13:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-10-03 13:13:31 (GMT)
commit8b4ecc93591895810fb1546a33a8dbd0ac0ab131 (patch)
tree5f8791b7d6fede6856ef719fbb242afe7ff5bc5f /generic/tkScrollbar.c
parentc235c1b9bd589c5b0d1fa2ca85f45f1521cf188c (diff)
downloadtk-8b4ecc93591895810fb1546a33a8dbd0ac0ab131.zip
tk-8b4ecc93591895810fb1546a33a8dbd0ac0ab131.tar.gz
tk-8b4ecc93591895810fb1546a33a8dbd0ac0ab131.tar.bz2
Convert %g to Tcl_PrintDouble to avoid locale trouble. [Bug 2112563]
Diffstat (limited to 'generic/tkScrollbar.c')
-rw-r--r--generic/tkScrollbar.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index d736539..611da88 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkScrollbar.c,v 1.14 2008/07/23 23:24:21 nijtmans Exp $
+ * RCS: @(#) $Id: tkScrollbar.c,v 1.15 2008/10/03 13:13:31 dkf Exp $
*/
#include "tkInt.h"
@@ -324,7 +324,7 @@ ScrollbarWidgetCmd(
} else {
fraction = ((double) pixels / (double) length);
}
- sprintf(buf, "%g", fraction);
+ Tcl_PrintDouble(NULL, fraction, buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
} else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) {
int x, y, pos, length;
@@ -359,7 +359,7 @@ ScrollbarWidgetCmd(
} else if (fraction > 1.0) {
fraction = 1.0;
}
- sprintf(buf, "%g", fraction);
+ Tcl_PrintDouble(NULL, fraction, buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
} else if ((c == 'g') && (strncmp(argv[1], "get", length) == 0)) {
if (argc != 2) {
@@ -370,8 +370,8 @@ ScrollbarWidgetCmd(
if (scrollPtr->flags & NEW_STYLE_COMMANDS) {
char first[TCL_DOUBLE_SPACE], last[TCL_DOUBLE_SPACE];
- Tcl_PrintDouble(interp, scrollPtr->firstFraction, first);
- Tcl_PrintDouble(interp, scrollPtr->lastFraction, last);
+ Tcl_PrintDouble(NULL, scrollPtr->firstFraction, first);
+ Tcl_PrintDouble(NULL, scrollPtr->lastFraction, last);
Tcl_AppendResult(interp, first, " ", last, NULL);
} else {
char buf[TCL_INTEGER_SPACE * 4];