diff --git a/apps/bookmark.c b/apps/bookmark.c index e0e9f8bd37..3d4705960c 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -508,22 +508,6 @@ static int buffer_bookmarks(struct bookmark_list* bookmarks, int first_line) return bookmarks->start + bookmarks->count; } -static char* strrsplt(char* str, int c) -{ - char* s = strrchr(str, c); - - if (s != NULL) - { - *s++ = '\0'; - } - else - { - s = str; - } - - return s; -} - static char* get_bookmark_info(int list_index, void* data, char *buffer) { struct bookmark_list* bookmarks = (struct bookmark_list*) data; diff --git a/apps/misc.c b/apps/misc.c index d81794d5e7..4af97afb5e 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -1076,3 +1076,19 @@ int hex_to_rgb(const char* hex) } #endif /* HAVE_LCD_COLOR */ +char* strrsplt(char* str, int c) +{ + char* s = strrchr(str, c); + + if (s != NULL) + { + *s++ = '\0'; + } + else + { + s = str; + } + + return s; +} + diff --git a/apps/misc.h b/apps/misc.h index b1af859aee..ab0e592aa0 100644 --- a/apps/misc.h +++ b/apps/misc.h @@ -113,4 +113,6 @@ void setvol(void); int hex_to_rgb(const char* hex); #endif +char* strrsplt(char* str, int c); + #endif /* MISC_H */ diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 7769e683d5..b00e1eba3d 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -372,10 +372,7 @@ static void format_name(char* dest, const char* src) strcpy(dest, p+1); /* Remove the extension */ - char* q = strrchr(dest, '.'); - - if (q != NULL) - *q = '\0'; + strrsplt(dest, '.'); break; }