summaryrefslogtreecommitdiffstats
path: root/ProcessUNIX.c
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2021-10-27 13:30:56 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-27 15:21:46 (GMT)
commit6015a898d463fc321187ae346155654d55393a4c (patch)
tree9413fdd221c42da73a35f6cf6c4945b67b13a18c /ProcessUNIX.c
parent58f046ba26d67c6e1ceda2a20977e316f1a942ad (diff)
downloadCMake-6015a898d463fc321187ae346155654d55393a4c.zip
CMake-6015a898d463fc321187ae346155654d55393a4c.tar.gz
CMake-6015a898d463fc321187ae346155654d55393a4c.tar.bz2
KWSys 2021-10-27 (e19a5668)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit e19a5668f01bb9d96440ce96e777749d6e92562d (e19a5668f01bb9d96440ce96e777749d6e92562d). Upstream Shortlog ----------------- Mathieu Westphal (1): e28d7282 DynamicLoader: Add RTLD_GLOBAL as a supported flag on linux Sean McBride (8): 704a63d4 Replace sprintf with snprintf f9f6d67b Replace non-standard _snprintf with standard snprintf f771c009 Fix -Wunused-macros warning by defining under same conditions as usage f3d4b12b Fix Wmissing-prototypes warnings by making functions static 6f4a1826 Fix Wmissing-variable-declarations by declaring variable in a header 31d25023 Fix all Wold-style-cast warnings 0f44b620 Fix Wreserved-id-macro warning by removing double underscore 44718539 Fix for extraneous semi-colon warning
Diffstat (limited to 'ProcessUNIX.c')
-rw-r--r--ProcessUNIX.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ProcessUNIX.c b/ProcessUNIX.c
index a8a15dd..1963b27 100644
--- a/ProcessUNIX.c
+++ b/ProcessUNIX.c
@@ -2287,7 +2287,8 @@ static void kwsysProcessSetExitExceptionByIndex(kwsysProcess* cp, int sig,
#endif
default:
cp->ProcessResults[idx].ExitException = kwsysProcess_Exception_Other;
- sprintf(cp->ProcessResults[idx].ExitExceptionString, "Signal %d", sig);
+ snprintf(cp->ProcessResults[idx].ExitExceptionString,
+ KWSYSPE_PIPE_BUFFER_SIZE + 1, "Signal %d", sig);
break;
}
}
@@ -2540,7 +2541,7 @@ static void kwsysProcessKill(pid_t process_id)
int pid;
if (sscanf(d->d_name, "%d", &pid) == 1 && pid != 0) {
struct stat finfo;
- sprintf(fname, "/proc/%d/stat", pid);
+ snprintf(fname, sizeof(fname), "/proc/%d/stat", pid);
if (stat(fname, &finfo) == 0) {
FILE* f = fopen(fname, "r");
if (f) {