Merge pull request #9495 from Jamiras/psx_cheevos_fixes

improve handling of line endings when calculating CD hashes for retroachievements
This commit is contained in:
Twinaphex 2019-09-21 19:57:12 +02:00 committed by GitHub
commit 2fca06c994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -1583,8 +1583,9 @@ found:
char disc_path[PATH_MAX_LENGTH];
char* tmp;
intfstream_read(m3u_stream, buffer, sizeof(buffer));
num_read = intfstream_read(m3u_stream, buffer, sizeof(buffer));
intfstream_close(m3u_stream);
buffer[num_read] = '\0';
tmp = buffer;
while (*tmp && *tmp != '\n')
@ -1640,7 +1641,7 @@ found:
if (exe_name)
{
scan = exe_name;
while (*scan != '\n' && *scan != ';' && *scan != ' ')
while (*scan != '\n' && *scan != '\r' && *scan != ';' && *scan != ' ')
++scan;
*scan = '\0';

View File

@ -344,8 +344,6 @@ static intfstream_t* cdfs_open_cue_track(const char* path, unsigned int track_in
while (*cue && *cue != '\n')
++cue;
if (cue == line)
continue;
if (*cue)
*cue++ = '\0';