Skip to content

Commit

Permalink
Merge pull request #710 from nvt/coffee-filename-fix
Browse files Browse the repository at this point in the history
Coffee: Copy the correct number of bytes in filenames
  • Loading branch information
Nicolas Tsiftes committed Jun 11, 2014
2 parents fb4fc31 + 7004355 commit 40d3365
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/cfs/cfs-coffee.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ reserve(const char *name, coffee_page_t pages,
}

memset(&hdr, 0, sizeof(hdr));
memcpy(hdr.name, name, sizeof(hdr.name) - 1);
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
hdr.max_pages = pages;
hdr.flags = HDR_FLAG_ALLOCATED | flags;
write_header(&hdr, page);
Expand Down

0 comments on commit 40d3365

Please sign in to comment.