diff options
Diffstat (limited to 'generic/tclStringObj.c')
| -rw-r--r-- | generic/tclStringObj.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index a556019..08c96f0 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2505,14 +2505,16 @@ Tcl_AppendFormatToObj( *p++ = '+'; } if (width) { - p += sprintf(p, "%" TCL_SIZE_MODIFIER "d", width); + p += snprintf( + p, TCL_INTEGER_SPACE, "%" TCL_SIZE_MODIFIER "d", width); if (width > length) { length = width; } } if (gotPrecision) { *p++ = '.'; - p += sprintf(p, "%" TCL_SIZE_MODIFIER "d", precision); + p += snprintf( + p, TCL_INTEGER_SPACE, "%" TCL_SIZE_MODIFIER "d", precision); if (precision > TCL_SIZE_MAX - length) { msg = overflow; errCode = "OVERFLOW"; |
