use memcpy instead of strlcpy, some cores request 1 byte at a time from the cuesheet

This commit is contained in:
Brad Parker 2019-06-23 19:28:39 -04:00
parent 08cd3a90f2
commit 0ad77800d9

View File

@ -854,11 +854,20 @@ int64_t retro_vfs_file_read_impl(libretro_vfs_implementation_file *stream,
if (string_is_equal_noncase(ext, "cue"))
{
if (len < stream->cdrom_cue_len - stream->cdrom_cue_pos)
{
#ifdef CDROM_DEBUG
printf("CDROM Read: Reading %lu bytes from cuesheet starting at %lu...\n", len, stream->cdrom_cue_pos);
printf("CDROM Read: Reading %lu bytes from cuesheet starting at %lu...\n", len, stream->cdrom_cue_pos);
#endif
strlcpy(s, stream->cdrom_cue_buf + stream->cdrom_cue_pos, len);
stream->cdrom_cue_pos += len;
memcpy(s, stream->cdrom_cue_buf + stream->cdrom_cue_pos, len);
stream->cdrom_cue_pos += len;
}
else
{
#ifdef CDROM_DEBUG
printf("CDROM Read: Reading %lu bytes from cuesheet starting at %lu failed.\n", len, stream->cdrom_cue_pos);
#endif
}
}
else if (string_is_equal_noncase(ext, "bin"))
{