diff options
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/playback.c b/apps/playback.c index c7c0b5e9c4..f41cca64a2 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -559,7 +559,6 @@ int audio_current_aa_hid(void) | |||
559 | struct mp3entry* audio_current_track(void) | 559 | struct mp3entry* audio_current_track(void) |
560 | { | 560 | { |
561 | const char *filename; | 561 | const char *filename; |
562 | const char *p; | ||
563 | static struct mp3entry temp_id3; | 562 | static struct mp3entry temp_id3; |
564 | struct playlist_track_info trackinfo; | 563 | struct playlist_track_info trackinfo; |
565 | int cur_idx; | 564 | int cur_idx; |
@@ -602,14 +601,12 @@ struct mp3entry* audio_current_track(void) | |||
602 | return &temp_id3; | 601 | return &temp_id3; |
603 | #endif | 602 | #endif |
604 | 603 | ||
605 | p = strrchr(filename, '/'); | 604 | strncpy(temp_id3.path, filename, sizeof(temp_id3.path)-1); |
606 | if (!p) | 605 | temp_id3.title = strrchr(temp_id3.path, '/'); |
607 | p = filename; | 606 | if (!temp_id3.title) |
607 | temp_id3.title = &temp_id3.path[0]; | ||
608 | else | 608 | else |
609 | p++; | 609 | temp_id3.title++; |
610 | |||
611 | strncpy(temp_id3.path, p, sizeof(temp_id3.path)-1); | ||
612 | temp_id3.title = &temp_id3.path[0]; | ||
613 | 610 | ||
614 | return &temp_id3; | 611 | return &temp_id3; |
615 | } | 612 | } |