diff options
author | Brad King <brad.king@kitware.com> | 2021-10-27 15:21:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-27 15:21:46 (GMT) |
commit | 848eeba483bef0cfeeef78ae77dc3c9a7327b8ea (patch) | |
tree | 3f8066f2905e9c1deb97f3f48db165edf8017289 /Source/kwsys/ProcessWin32.c | |
parent | a956be484783a991dbda3b14f676538d5f0b17bd (diff) | |
parent | 6015a898d463fc321187ae346155654d55393a4c (diff) | |
download | CMake-848eeba483bef0cfeeef78ae77dc3c9a7327b8ea.zip CMake-848eeba483bef0cfeeef78ae77dc3c9a7327b8ea.tar.gz CMake-848eeba483bef0cfeeef78ae77dc3c9a7327b8ea.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
KWSys 2021-10-27 (e19a5668)
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r-- | Source/kwsys/ProcessWin32.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index 8f01684..e97973e 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -29,7 +29,7 @@ a UNIX-style select system call. # define KWSYS_WINDOWS_DEPRECATED_GetVersionEx #endif #include <io.h> /* _unlink */ -#include <stdio.h> /* sprintf */ +#include <stdio.h> /* snprintf */ #include <string.h> /* strlen, strdup */ #ifndef _MAX_FNAME @@ -1867,18 +1867,18 @@ void kwsysProcessCleanup(kwsysProcess* cp, DWORD error) KWSYSPE_PIPE_BUFFER_SIZE, 0); if (length < 1) { /* FormatMessage failed. Use a default message. */ - _snprintf(cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE, - "Process execution failed with error 0x%X. " - "FormatMessage failed with error 0x%X", - error, GetLastError()); + snprintf(cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE, + "Process execution failed with error 0x%lX. " + "FormatMessage failed with error 0x%lX", + error, GetLastError()); } if (!WideCharToMultiByte(CP_UTF8, 0, err_msg, -1, cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE, NULL, NULL)) { /* WideCharToMultiByte failed. Use a default message. */ - _snprintf(cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE, - "Process execution failed with error 0x%X. " - "WideCharToMultiByte failed with error 0x%X", - error, GetLastError()); + snprintf(cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE, + "Process execution failed with error 0x%lX. " + "WideCharToMultiByte failed with error 0x%lX", + error, GetLastError()); } } @@ -2144,8 +2144,8 @@ static void kwsysProcessSetExitExceptionByIndex(kwsysProcess* cp, int code, case STATUS_NO_MEMORY: default: cp->ProcessResults[idx].ExitException = kwsysProcess_Exception_Other; - _snprintf(cp->ProcessResults[idx].ExitExceptionString, - KWSYSPE_PIPE_BUFFER_SIZE, "Exit code 0x%x\n", code); + snprintf(cp->ProcessResults[idx].ExitExceptionString, + KWSYSPE_PIPE_BUFFER_SIZE, "Exit code 0x%x\n", code); break; } } |