diff options
Diffstat (limited to 'src/LocateUri.cxx')
-rw-r--r-- | src/LocateUri.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/LocateUri.cxx b/src/LocateUri.cxx index dbc531f54..ac1bc0b93 100644 --- a/src/LocateUri.cxx +++ b/src/LocateUri.cxx @@ -42,11 +42,13 @@ LocateFileUri(const char *uri, const Client *client #ifdef ENABLE_DATABASE if (storage != nullptr) { - const char *suffix = storage->MapToRelativeUTF8(uri); - if (suffix != nullptr) + const auto suffix = storage->MapToRelativeUTF8(uri); + if (suffix.data() != nullptr) /* this path was relative to the music directory */ - return LocatedUri(LocatedUri::Type::RELATIVE, suffix); + // TODO: don't use suffix.data() (ok for now because we know it's null-terminated) + return LocatedUri(LocatedUri::Type::RELATIVE, + suffix.data()); } #endif @@ -80,9 +82,11 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri #ifdef ENABLE_DATABASE if (storage != nullptr) { - const char *suffix = storage->MapToRelativeUTF8(uri); - if (suffix != nullptr) - return LocatedUri(LocatedUri::Type::RELATIVE, suffix); + const auto suffix = storage->MapToRelativeUTF8(uri); + if (suffix.data() != nullptr) + // TODO: don't use suffix.data() (ok for now because we know it's null-terminated) + return LocatedUri(LocatedUri::Type::RELATIVE, + suffix.data()); } #endif |