diff --git a/driver.c b/driver.c index eb39f227b4..ab06831c6c 100644 --- a/driver.c +++ b/driver.c @@ -142,14 +142,18 @@ int find_driver_index(const char * label, const char *drv) * * Find previous driver in driver array. **/ -void find_prev_driver(const char *label, char *str, size_t sizeof_str) +bool find_prev_driver(const char *label, char *str, size_t sizeof_str) { int i = find_driver_index(label, str); if (i > 0) find_driver_nonempty(label, i - 1, str, sizeof_str); else + { RARCH_WARN( "Couldn't find any previous driver (current one: \"%s\").\n", str); + return false; + } + return true; } /** @@ -160,13 +164,17 @@ void find_prev_driver(const char *label, char *str, size_t sizeof_str) * * Find next driver in driver array. **/ -void find_next_driver(const char *label, char *str, size_t sizeof_str) +bool find_next_driver(const char *label, char *str, size_t sizeof_str) { int i = find_driver_index(label, str); if (i >= 0) find_driver_nonempty(label, i + 1, str, sizeof_str); else + { RARCH_WARN("Couldn't find any next driver (current one: \"%s\").\n", str); + return false; + } + return true; } /** diff --git a/driver.h b/driver.h index 6fd71662ce..e2ef62040d 100644 --- a/driver.h +++ b/driver.h @@ -329,8 +329,10 @@ void uninit_drivers(int flags); * @sizeof_str : size of @str. * * Find previous driver in driver array. + * + * Returns: true (1) if successful, otherwise false (0). **/ -void find_prev_driver(const char *label, char *str, size_t sizeof_str); +bool find_prev_driver(const char *label, char *str, size_t sizeof_str); /** * find_next_driver: @@ -339,8 +341,10 @@ void find_prev_driver(const char *label, char *str, size_t sizeof_str); * @sizeof_str : size of @str. * * Find next driver in driver array. + * + * Returns: true (1) if successful, otherwise false (0). **/ -void find_next_driver(const char *label, char *str, size_t sizeof_str); +bool find_next_driver(const char *label, char *str, size_t sizeof_str); /** * driver_set_nonblock_state: