diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-09-30 12:40:03 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-09-30 12:40:03 -0400 |
commit | 3881ec0a37f9880d6e602a8205b0fb2bd4d54b4f (patch) | |
tree | df6ba2a43912e0343a79e6e263d71da34eb2ac14 | |
parent | 4e45792a63fad1ed8ff159168b44387136e23b12 (diff) | |
download | stasis-3881ec0a37f9880d6e602a8205b0fb2bd4d54b4f.tar.gz |
Replace sprintf with snprintf
-rw-r--r-- | src/multiprocessing.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/multiprocessing.c b/src/multiprocessing.c index 039383e..5f5451e 100644 --- a/src/multiprocessing.c +++ b/src/multiprocessing.c @@ -292,7 +292,7 @@ int mp_pool_join(struct MultiProcessingPool *pool, size_t jobs, size_t flags) { char progress[1024] = {0}; if (pid > 0) { double percent = ((double) (tasks_complete + 1) / (double) pool->num_used) * 100; - sprintf(progress, "[%s:%s] [%3.1f%%]", pool->ident, slot->ident, percent); + snprintf(progress, sizeof(progress) - 1, "[%s:%s] [%3.1f%%]", pool->ident, slot->ident, percent); // The process ended in one the following ways // Note: SIGSTOP nor SIGCONT will not increment the tasks_complete counter |