aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-06-18 15:33:03 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-06-18 16:10:33 -0400
commit1fe4dec61c0599335bf1357fda527722a90fb491 (patch)
treeb1dad33ef44571a3e9b1f0f0951d28e22f85d18a
parent61cd8117ef012b3a0120cc1f29cd80327cdc497d (diff)
downloadstasis-1fe4dec61c0599335bf1357fda527722a90fb491.tar.gz
Fix snprintf length argument
-rw-r--r--src/lib/core/conda.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c
index fb7ee25..2b73862 100644
--- a/src/lib/core/conda.c
+++ b/src/lib/core/conda.c
@@ -241,7 +241,7 @@ int conda_exec(const char *args) {
static int conda_prepend_bin(const char *root) {
char conda_bin[PATH_MAX] = {0};
- snprintf(conda_bin, sizeof(conda_bin) - 1, "%s/bin", root);
+ snprintf(conda_bin, sizeof(conda_bin), "%s/bin", root);
if (env_manipulate_pathstr("PATH", conda_bin, PM_PREPEND | PM_ONCE)) {
return -1;
}
@@ -251,7 +251,7 @@ static int conda_prepend_bin(const char *root) {
static int conda_prepend_condabin(const char *root) {
char conda_condabin[PATH_MAX] = {0};
- snprintf(conda_condabin, sizeof(conda_condabin) - 1, "%s/condabin", root);
+ snprintf(conda_condabin, sizeof(conda_condabin), "%s/condabin", root);
if (env_manipulate_pathstr("PATH", conda_condabin, PM_PREPEND | PM_ONCE)) {
return -1;
}
@@ -360,7 +360,7 @@ int conda_activate(const char *root, const char *env_name) {
return -1;
}
- snprintf(command, sizeof(command) - 1,
+ snprintf(command, sizeof(command),
"set -a\n"
"source %s\n"
"__conda_exe() (\n"
@@ -557,7 +557,7 @@ int conda_env_create_from_uri(char *name, char *uri, char *python_version) {
// Rewrite python version
char spec[255] = {0};
- snprintf(spec, sizeof(spec) - 1, "- python=%s\n", python_version);
+ snprintf(spec, sizeof(spec), "- python=%s\n", python_version);
file_replace_text(tempfile, "- python\n", spec, 0);
const char *fmt = "env create -n '%s' --file='%s'";