Fix Truncation warning in cuesheet.c->browse_cuesheet

give user concrete indication that track title has been truncated
by adding '~' at end of string

Change-Id: I53034f4a09c103eb98ae1e0ef0a8a843fd2a2c6e
This commit is contained in:
William Wilgus 2018-12-08 04:43:44 -06:00
parent 0f5f5c3390
commit 6bfd7da97c

View file

@ -369,7 +369,8 @@ void browse_cuesheet(struct cuesheet *cue)
len = snprintf(title, sizeof(title), "%s: %s", cue->performer, cue->title);
if ((unsigned) len > sizeof(title))
DEBUGF("browse_cuesheet title truncated\n");
title[sizeof(title) - 2] = '~'; /* give indication of truncation */
gui_synclist_init(&lists, list_get_name_cb, cue, false, 2, NULL);
gui_synclist_set_nb_items(&lists, 2*cue->track_count);