aboutsummaryrefslogtreecommitdiff
path: root/tests/test_multiprocessing.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-15 10:10:15 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-15 10:10:15 -0400
commit87779a8c85eec0b71703ed3090a3949761396a15 (patch)
treec99afa5bca18be1ac2de9b937aa72b08d3285d44 /tests/test_multiprocessing.c
parent2258cd05bcded0125136c17d51568831ac421bf7 (diff)
downloadstasis-87779a8c85eec0b71703ed3090a3949761396a15.tar.gz
Replace sprintf with snprintf
* A few strcpy and strcat changes as well
Diffstat (limited to 'tests/test_multiprocessing.c')
-rw-r--r--tests/test_multiprocessing.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_multiprocessing.c b/tests/test_multiprocessing.c
index 3a462f1..3b98b77 100644
--- a/tests/test_multiprocessing.c
+++ b/tests/test_multiprocessing.c
@@ -65,7 +65,7 @@ void test_mp_task() {
for (size_t i = 0; i < sizeof(commands) / sizeof(*commands); i++) {
struct MultiProcessingTask *task;
char task_name[100] = {0};
- sprintf(task_name, "mytask%zu", i);
+ snprintf(task_name, sizeof(task_name), "mytask%zu", i);
STASIS_ASSERT_FATAL((task = mp_pool_task(pool, task_name, NULL, commands[i])) != NULL, "Task should not be NULL");
STASIS_ASSERT(task->pid == MP_POOL_PID_UNUSED, "PID should be non-zero at this point");
STASIS_ASSERT(task->parent_pid == MP_POOL_PID_UNUSED, "Parent PID should be non-zero");