summaryrefslogtreecommitdiff
path: root/src/queue/QueueSave.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/queue/QueueSave.cxx')
-rw-r--r--src/queue/QueueSave.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/queue/QueueSave.cxx b/src/queue/QueueSave.cxx
index cb8611cf8..3b9589450 100644
--- a/src/queue/QueueSave.cxx
+++ b/src/queue/QueueSave.cxx
@@ -83,8 +83,9 @@ queue_load_song(TextFile &file, const SongLoader &loader,
return;
uint8_t priority = 0;
- if (StringStartsWith(line, PRIO_LABEL)) {
- priority = strtoul(line + sizeof(PRIO_LABEL) - 1, nullptr, 10);
+ const char *p;
+ if ((p = StringAfterPrefix(line, PRIO_LABEL))) {
+ priority = strtoul(p, nullptr, 10);
line = file.ReadLine();
if (line == nullptr)
@@ -93,8 +94,8 @@ queue_load_song(TextFile &file, const SongLoader &loader,
DetachedSong *song;
- if (StringStartsWith(line, SONG_BEGIN)) {
- const char *uri = line + sizeof(SONG_BEGIN) - 1;
+ if ((p = StringAfterPrefix(line, PRIO_LABEL))) {
+ const char *uri = p;
Error error;
song = song_load(file, uri, error);