diff options
author | fvogel <fvogelnew1@free.fr> | 2023-01-18 20:23:38 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-01-18 20:23:38 (GMT) |
commit | e1fdc1e995e1e01172159c960f7fe8d611cfaf64 (patch) | |
tree | 66f5ec6ffcc6e3d649cc3d98b77882fbe92807e6 /macosx | |
parent | f413e249b3c0711dbefa5521ed2cc26c5bd20968 (diff) | |
parent | bc9027416eca9c0e52af3a412e4e012bc2495511 (diff) | |
download | tk-e1fdc1e995e1e01172159c960f7fe8d611cfaf64.zip tk-e1fdc1e995e1e01172159c960f7fe8d611cfaf64.tar.gz tk-e1fdc1e995e1e01172159c960f7fe8d611cfaf64.tar.bz2 |
Merge core-8-6-branch: Eradicate uses of sprintf because it triggers deprecation warning on macOS Ventura. Resolve conflicts. Remove sprintf calls specific to the main branch.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXPort.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXSend.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 88e4219..1e511c5 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -558,7 +558,7 @@ TkpTestembedCmd( if (containerPtr->parent == None) { Tcl_DStringAppendElement(&dString, ""); } else if (all) { - sprintf(buffer, "0x%" TCL_Z_MODIFIER "x", + snprintf(buffer, sizeof(buffer), "0x%" TCL_Z_MODIFIER "x", (size_t) containerPtr->parent); Tcl_DStringAppendElement(&dString, buffer); } else { diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 40f9dba..5c15838 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -289,14 +289,14 @@ static const char getSdefProc[] = "::tk::mac::GetDynamicSdef"; err = AEGetParamPtr(theDesc, keyDirectObject, typeWildCard, &initialType, NULL, 0, NULL); if (err != noErr) { - sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", (int)err); + snprintf(errString, sizeof(errString), "AEDoScriptHandler: GetParamDesc error %d", (int)err); AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, errString, strlen(errString)); return; } if (MissedAnyParameters((AppleEvent*)theDesc)) { - sprintf(errString, "AEDoScriptHandler: extra parameters"); + snprintf(errString, sizeof(errString), "AEDoScriptHandler: extra parameters"); AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar,errString, strlen(errString)); return; diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index 20784f2..5cc004b 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.h @@ -131,7 +131,7 @@ */ #define TkpPrintWindowId(buf,w) \ - sprintf((buf), "0x%lx", (unsigned long) (w)) + snprintf((buf), TCL_INTEGER_SPACE, "0x%lx", (unsigned long) (w)) /* * Turn off Tk double-buffering as Aqua windows are already double-buffered. diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c index 5b97923..1b3e2b3 100644 --- a/macosx/tkMacOSXSend.c +++ b/macosx/tkMacOSXSend.c @@ -263,11 +263,11 @@ Tk_SetAppName( Tcl_DStringAppend(&dString, name, -1); Tcl_DStringAppend(&dString, " #", 2); offset = Tcl_DStringLength(&dString); - Tcl_DStringSetLength(&dString, offset + 10); + Tcl_DStringSetLength(&dString, offset + TCL_INTEGER_SPACE); actualName = Tcl_DStringValue(&dString); } suffix++; - sprintf(Tcl_DStringValue(&dString) + offset, "%d", suffix); + snprintf(Tcl_DStringValue(&dString) + offset, TCL_INTEGER_SPACE, "%d", suffix); i = 0; } else { i++; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index fbbccef..5feb6e4 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -2079,7 +2079,7 @@ WmFrameCmd( if (window == None) { window = Tk_WindowId((Tk_Window)winPtr); } - sprintf(buf, "0x%" TCL_Z_MODIFIER "x", (size_t)window); + snprintf(buf, sizeof(buf), "0x%" TCL_Z_MODIFIER "x", (size_t)window); Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); return TCL_OK; } |