From f99fb4d3d0f66a32f272d68361d8a673cb177321 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Wed, 13 Jul 2022 11:18:49 +0200 Subject: [PATCH] Fix string bug in ADM_register_job.c --- examples/c/ADM_register_job.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/c/ADM_register_job.c b/examples/c/ADM_register_job.c index 17bf064f..b1b9926c 100644 --- a/examples/c/ADM_register_job.c +++ b/examples/c/ADM_register_job.c @@ -25,7 +25,7 @@ main(int argc, char* argv[]) { const char* pattern = "input-dataset-%d"; size_t n = snprintf(NULL, 0, pattern, i); char* id = (char*) malloc(n + 1); - snprintf(id, n, pattern, i); + snprintf(id, n + 1, pattern, i); inputs[i] = ADM_dataset_create(id); } @@ -35,7 +35,7 @@ main(int argc, char* argv[]) { const char* pattern = "output-dataset-%d"; size_t n = snprintf(NULL, 0, pattern, i); char* id = (char*) malloc(n + 1); - snprintf(id, n, pattern, i); + snprintf(id, n + 1, pattern, i); outputs[i] = ADM_dataset_create(id); } -- GitLab