diff --git a/content.h b/content.h index 776126cf515..612bc4e185e 100644 --- a/content.h +++ b/content.h @@ -135,7 +135,7 @@ char* content_get_subsystem_rom(unsigned index); bool content_set_subsystem_by_name(const char* subsystem_name); /* Get the current subsystem "friendly name" */ -void content_get_subsystem_friendly_name(const char* subsystem_name, char* subsystem_friendly_name, size_t len); +size_t content_get_subsystem_friendly_name(const char* subsystem_name, char *s, size_t len); /* Sets overrides which modify frontend handling of * specific content file types */ diff --git a/tasks/task_content.c b/tasks/task_content.c index ef7ff7f29e8..5c93ed43be7 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -2865,26 +2865,22 @@ bool content_set_subsystem_by_name(const char* subsystem_name) return false; } -void content_get_subsystem_friendly_name(const char* subsystem_name, char *s, size_t len) +size_t content_get_subsystem_friendly_name(const char* subsystem_name, char *s, size_t len) { - unsigned i = 0; + unsigned i; runloop_state_t *runloop_st = runloop_state_get_ptr(); rarch_system_info_t *sys_info = &runloop_st->system; /* Core not loaded completely, use the data we peeked on load core */ const struct retro_subsystem_info *subsystem = runloop_st->subsystem_data; - /* Core fully loaded, use the subsystem data */ if (sys_info->subsystem.data) subsystem = sys_info->subsystem.data; - for (i = 0; i < runloop_st->subsystem_current_count; i++, subsystem++) { if (string_is_equal(subsystem_name, subsystem->ident)) - { - strlcpy(s, subsystem->desc, len); - break; - } + return strlcpy(s, subsystem->desc, len); } + return 0; } /* Add a rom to the subsystem ROM buffer */