MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / FindStringSuffix

Function FindStringSuffix

src/util/StringCompare.cxx:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30const char *
31FindStringSuffix(const char *p, const char *suffix) noexcept
32{
33 const size_t p_length = StringLength(p);
34 const size_t suffix_length = StringLength(suffix);
35
36 if (p_length < suffix_length)
37 return nullptr;
38
39 const char *q = p + p_length - suffix_length;
40 return std::memcmp(q, suffix, suffix_length) == 0
41 ? q
42 : nullptr;
43}

Callers 1

LoadPlaylistFileInfoFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected