cleaner to use strpbrk

This commit is contained in:
markwkidd 2016-12-07 15:51:09 -05:00 committed by GitHub
parent a49912c863
commit f710129f32

View File

@ -466,10 +466,8 @@ static bool playlist_read_file(
/* Read playlist entry regardless
* of Windows or Unix line endings
*/
if(last = strrchr(buf[i], '\r'))
if((last = strpbrk(buf[i], "\n\r")))
*last = '\0';
else if(last = strrchr(buf[i], '\n'))
*last = '\0';
}
entry = &playlist->entries[playlist->size];