Merge pull request #710 from nvt/coffee-filename-fix

Coffee: Copy the correct number of bytes in filenames
This commit is contained in:
Nicolas Tsiftes 2014-06-11 18:10:12 +02:00
commit 40d33657a3

View file

@ -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);