diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 22:22:32 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 22:22:32 (GMT) |
| commit | feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0 (patch) | |
| tree | 196f438c5ba746829c249ad28e10c94a4a44ee0c /generic/tclStringObj.c | |
| parent | 67ced520761d9c2dff0022dafbebdb996e20b551 (diff) | |
| parent | ed24f448c79bc5af4c0f6fd77826a6552271dd9c (diff) | |
| download | tcl-feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0.zip tcl-feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0.tar.gz tcl-feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0.tar.bz2 | |
Merge 8.7
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 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; |
