diff options
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index e1f5160..de6dc2f 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2887,14 +2887,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"; @@ -2918,7 +2918,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; |