decoder/gme: use StringAfterPrefix()

This commit is contained in:
Max Kellermann 2020-06-10 21:02:28 +02:00
parent 14412c867f
commit 8925cc17d8
1 changed files with 2 additions and 4 deletions

View File

@ -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 != '.')