diff options
author | Max Kellermann <max@musicpd.org> | 2020-06-10 21:02:28 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-06-10 21:11:08 +0200 |
commit | 8925cc17d8436b6793930d11dc2168a3f66d8c94 (patch) | |
tree | 409f8bb51e41e5ecdd43717008ff6ba0e2b2588a /src/decoder/plugins/GmeDecoderPlugin.cxx | |
parent | 14412c867f00e54eb770398c9793f33415a5bf14 (diff) |
decoder/gme: use StringAfterPrefix()
Diffstat (limited to 'src/decoder/plugins/GmeDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/GmeDecoderPlugin.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/decoder/plugins/GmeDecoderPlugin.cxx b/src/decoder/plugins/GmeDecoderPlugin.cxx index 9d952890a..b194fc57d 100644 --- a/src/decoder/plugins/GmeDecoderPlugin.cxx +++ b/src/decoder/plugins/GmeDecoderPlugin.cxx @@ -37,7 +37,6 @@ #include <assert.h> #include <stdlib.h> -#include <string.h> #define SUBTUNE_PREFIX "tune_" @@ -75,11 +74,10 @@ gcc_pure static unsigned ParseSubtuneName(const char *base) noexcept { - if (memcmp(base, SUBTUNE_PREFIX, sizeof(SUBTUNE_PREFIX) - 1) != 0) + base = StringAfterPrefix(base, SUBTUNE_PREFIX); + if (base == nullptr) return 0; - base += sizeof(SUBTUNE_PREFIX) - 1; - char *endptr; auto track = strtoul(base, &endptr, 10); if (endptr == base || *endptr != '.') |