StateFile: use StringAfterPrefix() instead of StringStartsWith()

This commit is contained in:
Max Kellermann
2015-11-11 15:34:36 +01:00
parent c513478c31
commit 738583e3d4
4 changed files with 30 additions and 41 deletions

View File

@@ -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;