aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli/stasis/stasis_main.c6
-rw-r--r--src/lib/core/conda.c2
-rw-r--r--src/lib/core/utils.c6
-rw-r--r--src/lib/delivery/delivery_docker.c4
-rw-r--r--src/lib/delivery/delivery_install.c6
5 files changed, 15 insertions, 9 deletions
diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c
index b2d17b4..01a126e 100644
--- a/src/cli/stasis/stasis_main.c
+++ b/src/cli/stasis/stasis_main.c
@@ -698,6 +698,12 @@ int main(int argc, char *argv[]) {
configure_delivery_context(&ctx);
configure_jfrog_cli(&ctx);
+ /*
+ delivery_free(&ctx);
+ tpl_free();
+ globals_free();
+ return 0;
+ */
runtime_apply(ctx.runtime.environ);
strncpy(env_name, ctx.info.release_name, sizeof(env_name) - 1);
diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c
index 12d1a30..c8cdb25 100644
--- a/src/lib/core/conda.c
+++ b/src/lib/core/conda.c
@@ -63,7 +63,7 @@ int micromamba(const struct MicromambaInfo *info, char *command, ...) {
}
va_start(args, command);
- cmd_len = vsnprintf(cmd + strlen(cmd), sizeof(cmd) - cmd_len, command, args);
+ cmd_len = vsnprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(cmd) - cmd_len, command, args);
if (cmd_len < 0) {
SYSERROR("%s", "Unable to append arguments to micromamba command");
va_end(args);
diff --git a/src/lib/core/utils.c b/src/lib/core/utils.c
index f65a1d8..ea23024 100644
--- a/src/lib/core/utils.c
+++ b/src/lib/core/utils.c
@@ -322,7 +322,7 @@ int git_clone(struct Process *proc, char *url, char *destdir, char *gitref) {
// Destination directory does not exist
const char *command_fmt = " %s";
const int command_fmt_len = snprintf(NULL, 0, command_fmt, destdir);
- snprintf(command + strlen(command), sizeof(command) - command_fmt_len, command_fmt, destdir);
+ snprintf(command + strlen(command), sizeof(command) - strlen(command) - command_fmt_len, command_fmt, destdir);
// Clone the repo
result = shell(proc, command);
if (result) {
@@ -928,7 +928,7 @@ void debug_hexdump(char *data, int len) {
if (count == 0) {
const char *pos_fmt = "%p";
const int pos_fmt_len = snprintf(NULL, 0, pos_fmt, pos);
- snprintf(addr + strlen(addr), sizeof(addr) - pos_fmt_len, pos_fmt, pos);
+ snprintf(addr + strlen(addr), sizeof(addr) - strlen(addr) - pos_fmt_len, pos_fmt, pos);
}
if (count == 8) {
strncat(bytes, " ", sizeof(bytes) - strlen(bytes) - 1);
@@ -946,7 +946,7 @@ void debug_hexdump(char *data, int len) {
const char *bytes_fmt = "%02X ";
const int bytes_fmt_len = snprintf(NULL, 0, bytes_fmt, (unsigned char) *pos);
- snprintf(bytes + strlen(bytes), sizeof(bytes) - bytes_fmt_len, bytes_fmt, (unsigned char) *pos);
+ snprintf(bytes + strlen(bytes), sizeof(bytes) - strlen(bytes) - bytes_fmt_len, bytes_fmt, (unsigned char) *pos);
const char *ascii_fmt = "%c";
// no need to calculate length for a single character
diff --git a/src/lib/delivery/delivery_docker.c b/src/lib/delivery/delivery_docker.c
index e5f1c2f..6aa977a 100644
--- a/src/lib/delivery/delivery_docker.c
+++ b/src/lib/delivery/delivery_docker.c
@@ -49,7 +49,7 @@ int delivery_docker(struct Delivery *ctx) {
const char *tag_fmt = " -t \"%s\" ";
const int tag_fmt_len = snprintf(NULL, 0, tag_fmt, tag);
- snprintf(args + strlen(args), tag_fmt_len, tag_fmt, tag);
+ snprintf(args + strlen(args), sizeof(args) - strlen(args) - tag_fmt_len, tag_fmt, tag);
}
// Append build arguments to command (i.e. --build-arg "key=value"
@@ -61,7 +61,7 @@ int delivery_docker(struct Delivery *ctx) {
const char *build_arg_fmt = " --build-arg \"%s\" ";
const int build_arg_fmt_len = snprintf(NULL, 0, build_arg_fmt, build_arg);
- snprintf(args + strlen(args), sizeof(args) - build_arg_fmt_len, build_arg_fmt, build_arg);
+ snprintf(args + strlen(args), sizeof(args) - strlen(args) - build_arg_fmt_len, build_arg_fmt, build_arg);
}
// Build the image
diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c
index 51b78fa..26bd98f 100644
--- a/src/lib/delivery/delivery_install.c
+++ b/src/lib/delivery/delivery_install.c
@@ -320,7 +320,7 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha
return -1;
}
}
- snprintf(args + strlen(args), required_len + 1, fmt, req, info->version);
+ snprintf(args + strlen(args), sizeof(args) - strlen(args) - required_len + 1, fmt, req, info->version);
} else {
fprintf(stderr, "Deferred package '%s' is not present in the tested package list!\n", name);
guard_free(args);
@@ -338,7 +338,7 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha
return -1;
}
}
- snprintf(args + strlen(args), required_len + 1, fmt, name);
+ snprintf(args + strlen(args), sizeof(args) - strlen(args) - required_len + 1, fmt, name);
} else {
const char *fmt_append = "%s '%s'";
const char *fmt = " '%s'";
@@ -350,7 +350,7 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha
return -1;
}
}
- snprintf(args + strlen(args), required_len + 1, fmt, name);
+ snprintf(args + strlen(args), sizeof(args) - strlen(args) - required_len + 1, fmt, name);
}
}
}