summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-07-25 08:12:44 +0200
committerWilliam Wilgus <me.theuser@yahoo.com>2018-07-25 08:13:19 +0200
commitc332180afd8ac408883ba79c6c4d9c86120198e0 (patch)
treea74a30cdd67e6d70b9858a5bdb2cbfdea6e4a0dc /apps
parenta81c63160c5d1da3a5c2b407fae58daead6199a8 (diff)
downloadrockbox-c332180afd8ac408883ba79c6c4d9c86120198e0.tar.gz
rockbox-c332180afd8ac408883ba79c6c4d9c86120198e0.tar.bz2
rockbox-c332180afd8ac408883ba79c6c4d9c86120198e0.zip
Fix cuesheet printf truncation
Change-Id: I48189c3ce29f27d4b3bb4f874c80636c1f0ca6b6
Diffstat (limited to 'apps')
-rw-r--r--apps/cuesheet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index c195460205..c3df275f05 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -364,8 +364,9 @@ void browse_cuesheet(struct cuesheet *cue)
struct cuesheet_file cue_file;
struct mp3entry *id3 = audio_current_track();
- snprintf(title, sizeof(title), "%s: %.*s", cue->performer,
- MAX_PATH - strlen(cue->performer) - 3, cue->title);
+ int remaining = 0;
+ snprintf(title, sizeof(title), "%s: %n%.*s", cue->performer,
+ &remaining, MAX_PATH - remaining, cue->title);
gui_synclist_init(&lists, list_get_name_cb, cue, false, 2, NULL);
gui_synclist_set_nb_items(&lists, 2*cue->track_count);