diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 22:02:55 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 22:02:55 (GMT) |
commit | dc5930bc812a27e31bf8a0aa2fcf564ed7306a26 (patch) | |
tree | cfdd8df6ed6eeb844e46e1d630692a8a6137fbb9 /win/tclWinInit.c | |
parent | f8b9e919c954be237c906a708530111607f88081 (diff) | |
parent | 186145578675341deb63fd53e6080896695c3574 (diff) | |
download | tcl-dc5930bc812a27e31bf8a0aa2fcf564ed7306a26.zip tcl-dc5930bc812a27e31bf8a0aa2fcf564ed7306a26.tar.gz tcl-dc5930bc812a27e31bf8a0aa2fcf564ed7306a26.tar.bz2 |
Merge 8.6
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index a11e732..2eaaa09 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -141,7 +141,7 @@ TclpInitLibraryPath( * installed DLL. */ - sprintf(installLib, "lib/tcl%s", TCL_VERSION); + snprintf(installLib, sizeof(installLib), "lib/tcl%s", TCL_VERSION); /* * Look for the library relative to the TCL_LIBRARY env variable. If the @@ -304,7 +304,7 @@ InitializeDefaultLibraryDir( *end = '\\'; TclWinNoBackslash(name); - sprintf(end + 1, "lib/tcl%s", TCL_VERSION); + snprintf(end + 1, LIBRARY_SIZE, "lib/tcl%s", TCL_VERSION); *lengthPtr = strlen(name); *valuePtr = (char *)ckalloc(*lengthPtr + 1); *encodingPtr = NULL; @@ -352,7 +352,7 @@ InitializeSourceLibraryDir( *end = '\\'; TclWinNoBackslash(name); - sprintf(end + 1, "../library"); + snprintf(end + 1, LIBRARY_SIZE, "../library"); *lengthPtr = strlen(name); *valuePtr = (char *)ckalloc(*lengthPtr + 1); *encodingPtr = NULL; @@ -404,7 +404,7 @@ Tcl_GetEncodingNameFromEnvironment( Tcl_DStringAppend(bufPtr, "utf-8", 5); } else { Tcl_DStringSetLength(bufPtr, 2+TCL_INTEGER_SPACE); - wsprintfA(Tcl_DStringValue(bufPtr), "cp%d", GetACP()); + snprintf(Tcl_DStringValue(bufPtr), 2+TCL_INTEGER_SPACE, "cp%d", GetACP()); Tcl_DStringSetLength(bufPtr, strlen(Tcl_DStringValue(bufPtr))); } return Tcl_DStringValue(bufPtr); @@ -488,7 +488,7 @@ TclpSetVariables( if (osInfo.dwMajorVersion == 10 && osInfo.dwBuildNumber >= 22000) { osInfo.dwMajorVersion = 11; } - wsprintfA(buffer, "%d.%d", osInfo.dwMajorVersion, osInfo.dwMinorVersion); + snprintf(buffer, sizeof(buffer), "%ld.%ld", osInfo.dwMajorVersion, osInfo.dwMinorVersion); Tcl_SetVar2(interp, "tcl_platform", "osVersion", buffer, TCL_GLOBAL_ONLY); if (sys.oemId.wProcessorArchitecture < NUMPROCESSORS) { Tcl_SetVar2(interp, "tcl_platform", "machine", |