diff options
Diffstat (limited to '')
-rw-r--r-- | src/decoder/_flac_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/decoder/_flac_common.c b/src/decoder/_flac_common.c index 213516524..f12b8bff0 100644 --- a/src/decoder/_flac_common.c +++ b/src/decoder/_flac_common.c @@ -223,11 +223,11 @@ flac_vtrack_tnum(const char* fname) * another/better way would be to use tag struct */ char* ptr = strrchr(fname, '_'); + if (ptr == NULL) + return 0; // copy ascii tracknumber to int - char vtrack[4]; - g_strlcpy(vtrack, ++ptr, 4); - return (unsigned int)strtol(vtrack, NULL, 10); + return (unsigned int)strtol(++ptr, NULL, 10); } #endif /* FLAC_API_VERSION_CURRENT >= 7 */ |