Skip to content

Commit eaadf86

Browse files
committed
mfu: use strncpy to pad short paths with zero when writing cache file
Signed-off-by: Adam Moody <[email protected]>
1 parent 9e1b465 commit eaadf86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/mfu_flist_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void buft_pack(void* buf, const buf_t* items)
8686
sptr += items->chars;
8787
dptr += items->chars;
8888

89-
/* pack uint64 into destionation */
89+
/* pack uint64 into destination */
9090
mfu_pack_io_uint64(&dptr, *(const uint64_t*)sptr);
9191
sptr += sizeof(uint64_t);
9292
}
@@ -247,7 +247,7 @@ static size_t list_elem_pack(void* buf, int detail, uint64_t chars, const elem_t
247247

248248
/* copy in file name */
249249
char* file = elem->file;
250-
strcpy(ptr, file);
250+
strncpy(ptr, file, chars);
251251
ptr += chars;
252252

253253
if (detail) {

0 commit comments

Comments
 (0)