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

@@ -98,10 +98,10 @@ read_sw_volume_state(const char *line, MultipleOutputs &outputs)
char *end = nullptr;
long int sv;
if (!StringStartsWith(line, SW_VOLUME_STATE))
line = StringAfterPrefix(line, SW_VOLUME_STATE);
if (line == nullptr)
return false;
line += sizeof(SW_VOLUME_STATE) - 1;
sv = strtol(line, &end, 10);
if (*end == 0 && sv >= 0 && sv <= 100)
software_volume_change(outputs, sv);