diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 22:27:40 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-30 22:27:40 (GMT) |
commit | 0758324455f7cd805291c1062b6c7fb70fd13647 (patch) | |
tree | d71c67987bcd3070c793c82e843fd8aedc8032ca /win/tclWinInit.c | |
parent | 812c3e3103658db7d4e360b9203097c339a3a204 (diff) | |
parent | feac96c8b3c738ef7cb8e3e89e076aa4f23f13b0 (diff) | |
download | tcl-0758324455f7cd805291c1062b6c7fb70fd13647.zip tcl-0758324455f7cd805291c1062b6c7fb70fd13647.tar.gz tcl-0758324455f7cd805291c1062b6c7fb70fd13647.tar.bz2 |
Merge 9.0
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 cf74228..d44e58c 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 *)Tcl_Alloc(*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 *)Tcl_Alloc(*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", |