aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis_indexer/helpers.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2026-04-28 11:45:10 -0400
committerGitHub <noreply@github.com>2026-04-28 11:45:10 -0400
commit10f13b36560c5112554c54d8958081b7aa518050 (patch)
treebd27866c4352de38ebc5b13f8208768d576ae904 /src/cli/stasis_indexer/helpers.c
parent017bc273aedf3f20512beeb78a2f513913e56305 (diff)
parentd761cc976a8d645e61d23f6e43dcfec1a7fdb061 (diff)
downloadstasis-10f13b36560c5112554c54d8958081b7aa518050.tar.gz
Merge pull request #137 from jhunkeler/bughunt-1001
Bug Hunt 0x1001
Diffstat (limited to 'src/cli/stasis_indexer/helpers.c')
-rw-r--r--src/cli/stasis_indexer/helpers.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c
index 23e4f5a..425d209 100644
--- a/src/cli/stasis_indexer/helpers.c
+++ b/src/cli/stasis_indexer/helpers.c
@@ -121,7 +121,11 @@ int pandoc_exec(const char *in_file, const char *out_file, const char *css_file,
// Converts a markdown file to html
char cmd[STASIS_BUFSIZ] = {0};
strncpy(cmd, "pandoc ", sizeof(cmd) - 1);
+ cmd[sizeof(cmd) - 1] = '\0';
+
strncat(cmd, pandoc_versioned_args, sizeof(cmd) - strlen(cmd) - 1);
+ cmd[sizeof(cmd) - 1] = '\0';
+
if (css_file && strlen(css_file)) {
strncat(cmd, "--css ", sizeof(cmd) - strlen(cmd) - 1);
strncat(cmd, css_file, sizeof(cmd) - strlen(cmd) - 1);
@@ -152,6 +156,7 @@ int micromamba_configure(const struct Delivery *ctx, struct MicromambaInfo *m) {
}
m->conda_prefix = globals.conda_install_prefix;
m->micromamba_prefix = micromamba_prefix;
+ m->download_dir = ctx->storage.tmpdir;
const size_t pathvar_len = strlen(getenv("PATH")) + strlen(m->micromamba_prefix) + strlen(m->conda_prefix) + 3 + 4 + 1;
// ^^^^^^^^^^^^^^^^^^
@@ -397,8 +402,11 @@ int write_manifest(const char *path, char **exclude_path, FILE *fp) {
}
char filepath[PATH_MAX] = {0};
strncpy(filepath, path, PATH_MAX - 1);
+ filepath[PATH_MAX - 1] = '\0';
+
strncat(filepath, "/", sizeof(filepath) - strlen(filepath) - 1);
strncat(filepath, rec->d_name, sizeof(filepath) - strlen(filepath) - 1);
+
if (rec->d_type == DT_DIR) {
write_manifest(filepath, exclude_path, fp);
continue;