diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-04-30 19:25:55 -0700 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-05-30 13:36:53 +0200 |
commit | e4dad42ca123b9f0f987218c68c42422d6735c0a (patch) | |
tree | 6cf4c3d28e251b285cfe5a30e842edfc3080d6bc /src/PlaylistDatabase.cxx | |
parent | 99afe8e6d1157c0d443ccbe4b571797cce5b2304 (diff) |
use std chr functions
The ones in std have overloads for const char/char.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/PlaylistDatabase.cxx')
-rw-r--r-- | src/PlaylistDatabase.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/PlaylistDatabase.cxx b/src/PlaylistDatabase.cxx index 1ec3543fb..24635708b 100644 --- a/src/PlaylistDatabase.cxx +++ b/src/PlaylistDatabase.cxx @@ -25,7 +25,8 @@ #include "util/StringStrip.hxx" #include "util/RuntimeError.hxx" -#include <string.h> +#include <cstring> + #include <stdlib.h> void @@ -49,8 +50,8 @@ playlist_metadata_load(TextFile &file, PlaylistVector &pv, const char *name) const char *value; while ((line = file.ReadLine()) != nullptr && - strcmp(line, "playlist_end") != 0) { - colon = strchr(line, ':'); + std::strcmp(line, "playlist_end") != 0) { + colon = std::strchr(line, ':'); if (colon == nullptr || colon == line) throw FormatRuntimeError("unknown line in db: %s", line); @@ -58,7 +59,7 @@ playlist_metadata_load(TextFile &file, PlaylistVector &pv, const char *name) *colon++ = 0; value = StripLeft(colon); - if (strcmp(line, "mtime") == 0) + if (std::strcmp(line, "mtime") == 0) pm.mtime = std::chrono::system_clock::from_time_t(strtol(value, nullptr, 10)); else throw FormatRuntimeError("unknown line in db: %s", |