From 2c417fd82ab63a8bd8e9504f080a7d56a17fceeb Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 22 Apr 2026 13:36:40 -0400 Subject: Fix string append operation --- src/lib/core/conda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c index 90c6ba1..12d1a30 100644 --- a/src/lib/core/conda.c +++ b/src/lib/core/conda.c @@ -513,7 +513,7 @@ int conda_setup_headless() { continue; } const int cmd_fmt_len = snprintf(NULL, 0, cmd_fmt, item); - snprintf(cmd + strlen(cmd), sizeof(cmd) - cmd_fmt_len, cmd_fmt, item); + snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(cmd) - cmd_fmt_len, cmd_fmt, item); if (i < total - 1) { strncat(cmd, " ", sizeof(cmd) - strlen(cmd) - 1); } @@ -536,7 +536,7 @@ int conda_setup_headless() { continue; } const int cmd_fmt_len = snprintf(NULL, 0, cmd_fmt, item); - snprintf(cmd + strlen(cmd), sizeof(cmd) - cmd_fmt_len, cmd_fmt, item); + snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(cmd) - cmd_fmt_len, cmd_fmt, item); if (i < total - 1) { strncat(cmd, " ", sizeof(cmd) - strlen(cmd) - 1); } -- cgit