From 610292db61dc8100b58c342129ea7319f3346673 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sun, 17 Jul 2022 18:38:28 +0200 Subject: [PATCH] Replace more trivial sscanf usage with strtol --- libretro-common/media/media_detect_cd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libretro-common/media/media_detect_cd.c b/libretro-common/media/media_detect_cd.c index 6985fc7268..e16a4db2ee 100644 --- a/libretro-common/media/media_detect_cd.c +++ b/libretro-common/media/media_detect_cd.c @@ -149,8 +149,8 @@ bool media_detect_cd_info_cue(const char *path, media_detect_cd_info_t *info) if (!string_is_empty(track)) { - unsigned track_number = 0; - sscanf(track, "%d", (int*)&track_number); + char *ptr = NULL; + unsigned track_number = (unsigned)strtol(track, &ptr, 10); #ifdef MEDIA_CUE_PARSE_DEBUG printf("Found track: %d\n", track_number); fflush(stdout); @@ -185,8 +185,8 @@ bool media_detect_cd_info_cue(const char *path, media_detect_cd_info_t *info) if (!string_is_empty(index)) { - unsigned index_number = 0; - sscanf(index, "%d", (int*)&index_number); + char *ptr = NULL; + unsigned index_number = (unsigned)strtol(index, &ptr, 10); if (index_number == 1) {