Merge pull request #10171 from gordon-fish/patch-1

Fix to correctly set header.metadata_offset
This commit is contained in:
Twinaphex 2020-02-28 16:59:49 +01:00 committed by GitHub
commit a10db7c280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,8 +173,7 @@ int libretrodb_create(RFILE *fd, libretrodb_value_provider value_provider,
if ((rv = rmsgpack_dom_write(fd, &sentinal)) < 0)
goto clean;
header.metadata_offset = swap_if_little64(filestream_seek(
fd, 0, RETRO_VFS_SEEK_POSITION_CURRENT));
header.metadata_offset = swap_if_little64(filestream_tell(fd));
md.count = item_count;
libretrodb_write_metadata(fd, &md);
filestream_seek(fd, root, RETRO_VFS_SEEK_POSITION_START);