summaryrefslogtreecommitdiffstats
path: root/generic/tkScale.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkScale.c')
-rw-r--r--generic/tkScale.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tkScale.c b/generic/tkScale.c
index 28e5b16..258a1fa 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -632,7 +632,12 @@ ConfigureScale(
scalePtr->tickInterval = -scalePtr->tickInterval;
}
- ComputeFormat(scalePtr);
+ if (scalePtr->digits > TCL_MAX_PREC) {
+ Tcl_AppendResult(interp, "too large -digits value", NULL);
+ continue;
+ } else {
+ ComputeFormat(scalePtr);
+ }
scalePtr->labelLength = scalePtr->label ? (int)strlen(scalePtr->label) : 0;
@@ -888,7 +893,7 @@ static void
ComputeScaleGeometry(
register TkScale *scalePtr) /* Information about widget. */
{
- char valueString[PRINT_CHARS];
+ char valueString[TCL_DOUBLE_SPACE];
int tmp, valuePixels, x, y, extraSpace;
Tk_FontMetrics fm;
@@ -1304,7 +1309,7 @@ ScaleSetVariable(
register TkScale *scalePtr) /* Info about widget. */
{
if (scalePtr->varNamePtr != NULL) {
- char string[PRINT_CHARS];
+ char string[TCL_DOUBLE_SPACE];
sprintf(string, scalePtr->format, scalePtr->value);
scalePtr->flags |= SETTING_VAR;