diff options
Diffstat (limited to 'utils/container.c')
-rw-r--r-- | utils/container.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/container.c b/utils/container.c index 016ba153c..adf72b78e 100644 --- a/utils/container.c +++ b/utils/container.c @@ -322,8 +322,14 @@ struct container_ctx *container_create(const char *filename, ctx->entries = 0; ctx->directory = NULL; ctx->header.parser = htonl(3); - strncpy((char *)ctx->header.name, (char *)name, 32); - strncpy((char *)ctx->header.author, (char *)author, 64); + + snprintf((char *)ctx->header.name, + sizeof(ctx->header.name), + "%s", (char *)name); + + snprintf((char *)ctx->header.author, + sizeof(ctx->header.author), + "%s", (char *)author); val = fwrite("NSTM", 4, 1, ctx->fh); if (val == 0) |