From 9e2c82c26e4718f9d9800faf698e848805a864a8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 30 Apr 2019 10:12:00 +0200 Subject: [PATCH] (Scanner) Shorten scanner string --- tasks/task_database.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tasks/task_database.c b/tasks/task_database.c index 8ade0e6cd3..ef61c7f11e 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -134,21 +134,24 @@ static const char *database_info_get_current_element_name( static int task_database_iterate_start(database_info_handle_t *db, const char *name) { - char msg[511]; + char msg[256]; + const char *basename_path = !string_is_empty(name) ? + path_basename(name) : ""; - msg[0] = msg[510] = '\0'; + msg[0] = '\0'; snprintf(msg, sizeof(msg), STRING_REP_USIZE "/" STRING_REP_USIZE ": %s %s...\n", (size_t)db->list_ptr, (size_t)db->list->size, msg_hash_to_str(MSG_SCANNING), - name); + basename_path); if (!string_is_empty(msg)) { #ifdef RARCH_INTERNAL - runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + runloop_msg_queue_push(msg, 1, 180, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); #else fprintf(stderr, "msg: %s\n", msg); #endif