summaryrefslogtreecommitdiff
path: root/core/build.c
diff options
context:
space:
mode:
authorChloe M. <chloe@aptel.org>2026-08-22 09:55:10 +0000
committerChloe M. <chloe@aptel.org>2026-08-22 09:55:10 +0000
commit2c36453937e2772f7f6d4d755aa82563c2c8968b (patch)
tree47ad3d16d48a492510aa74372920912c5c1b6b2c /core/build.c
parent7683205c69c76b6515c242429a927974aedfb5c0 (diff)
core: build: Use strtok_r in build.c
Signed-off-by: Chloe M. <chloe@aptel.org>
Diffstat (limited to 'core/build.c')
-rw-r--r--core/build.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/build.c b/core/build.c
index 8bb7a3c..ab80cad 100644
--- a/core/build.c
+++ b/core/build.c
@@ -356,6 +356,7 @@ try_mf_make(const char *dirpath, const char *manifest_entry,
bool *rehash)
{
char *p, *tok, *name;
+ char *save;
char pathbuf[256];
char hash[BOP_HASH_LEN];
int error;
@@ -375,7 +376,7 @@ try_mf_make(const char *dirpath, const char *manifest_entry,
}
/* Grab the filename and construct a path */
- tok = strtok(p, ":");
+ tok = strtok_r(p, ":", &save);
snprintf(pathbuf, sizeof(pathbuf), "%s/%s", dirpath, tok);
/* Copy the name */
@@ -385,7 +386,7 @@ try_mf_make(const char *dirpath, const char *manifest_entry,
}
/* Grab the old hash and create a new hash */
- tok = strtok(NULL, ":");
+ tok = strtok_r(NULL, ":", &save);
if ((error = bop_hash_file(pathbuf, hash)) < 0) {
printf("[!] failed to hash %s\n", pathbuf);
free(p);