summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 34b185d..959a221 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2481,14 +2481,14 @@ Tcl_AppendFormatToObj(
*p++ = '+';
}
if (width) {
- p += sprintf(p, "%d", width);
+ p += snprintf(p, TCL_INTEGER_SPACE, "%d", width);
if (width > length) {
length = width;
}
}
if (gotPrecision) {
*p++ = '.';
- p += sprintf(p, "%d", precision);
+ p += snprintf(p, TCL_INTEGER_SPACE, "%d", precision);
if (precision > INT_MAX - length) {
msg = overflow;
errCode = "OVERFLOW";
@@ -2512,7 +2512,7 @@ Tcl_AppendFormatToObj(
goto errorMsg;
}
bytes = TclGetString(segment);
- if (!Tcl_AttemptSetObjLength(segment, sprintf(bytes, spec, d))) {
+ if (!Tcl_AttemptSetObjLength(segment, snprintf(bytes, segment->length, spec, d))) {
msg = overflow;
errCode = "OVERFLOW";
goto errorMsg;