diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 21:20:30 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 21:20:30 (GMT) |
commit | 186145578675341deb63fd53e6080896695c3574 (patch) | |
tree | 4aa12b60fc6ad7ca4c19658d774dee4326ad165b /generic/tclStringObj.c | |
parent | 784535a35c779f46886fe9a880b706c979efdd77 (diff) | |
parent | 191fecdc87592dfea94718bc716551c72f072c33 (diff) | |
download | tcl-186145578675341deb63fd53e6080896695c3574.zip tcl-186145578675341deb63fd53e6080896695c3574.tar.gz tcl-186145578675341deb63fd53e6080896695c3574.tar.bz2 |
Fix [0cb3554903]: macOS 13 SDK deprecates sprintf()
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 720ed44..b42eeb3 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2483,14 +2483,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"; @@ -2514,7 +2514,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; |