aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-22 13:36:40 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-22 13:36:40 -0400
commit2c417fd82ab63a8bd8e9504f080a7d56a17fceeb (patch)
treee890eedd14de6048854200d5e1343a9a9277ea82
parent0d74970b8e7313e4dd722efce135c24de4aba7b2 (diff)
downloadstasis-2c417fd82ab63a8bd8e9504f080a7d56a17fceeb.tar.gz
Fix string append operation
-rw-r--r--src/lib/core/conda.c4
1 files changed, 2 insertions, 2 deletions
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);
}