Commit 8925cc17 authored by Max Kellermann's avatar Max Kellermann

decoder/gme: use StringAfterPrefix()

parent 14412c86
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#define SUBTUNE_PREFIX "tune_" #define SUBTUNE_PREFIX "tune_"
...@@ -75,11 +74,10 @@ gcc_pure ...@@ -75,11 +74,10 @@ gcc_pure
static unsigned static unsigned
ParseSubtuneName(const char *base) noexcept 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; return 0;
base += sizeof(SUBTUNE_PREFIX) - 1;
char *endptr; char *endptr;
auto track = strtoul(base, &endptr, 10); auto track = strtoul(base, &endptr, 10);
if (endptr == base || *endptr != '.') if (endptr == base || *endptr != '.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment