aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-11-11 15:34:36 +0100
committerMax Kellermann <max@duempel.org>2015-11-11 15:34:36 +0100
commit738583e3d4cd7a35aec545448f86a8c097768785 (patch)
tree67e0ed29ea1aa6c44ccaa7de1b5297715bc06f43 /src/output
parentc513478c31c8543309da5f04bb472ea6e4969603 (diff)
downloadmpd-738583e3d4cd7a35aec545448f86a8c097768785.tar.gz
mpd-738583e3d4cd7a35aec545448f86a8c097768785.tar.xz
mpd-738583e3d4cd7a35aec545448f86a8c097768785.zip
StateFile: use StringAfterPrefix() instead of StringStartsWith()
Diffstat (limited to 'src/output')
-rw-r--r--src/output/OutputState.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/output/OutputState.cxx b/src/output/OutputState.cxx
index e866eb507..421e2fa91 100644
--- a/src/output/OutputState.cxx
+++ b/src/output/OutputState.cxx
@@ -56,11 +56,10 @@ audio_output_state_read(const char *line, MultipleOutputs &outputs)
char *endptr;
const char *name;
- if (!StringStartsWith(line, AUDIO_DEVICE_STATE))
+ line = StringAfterPrefix(line, AUDIO_DEVICE_STATE);
+ if (line == nullptr)
return false;
- line += sizeof(AUDIO_DEVICE_STATE) - 1;
-
value = strtol(line, &endptr, 10);
if (*endptr != ':' || (value != 0 && value != 1))
return false;