Commit c63bd323 authored by Max Kellermann's avatar Max Kellermann

util/StringCompare: use std::memcmp()

parent 55db7105
......@@ -29,7 +29,7 @@
#include "StringCompare.hxx"
#include <string.h>
#include <cstring>
bool
StringEndsWith(const char *haystack, const char *needle) noexcept
......@@ -38,8 +38,8 @@ StringEndsWith(const char *haystack, const char *needle) noexcept
const size_t needle_length = StringLength(needle);
return haystack_length >= needle_length &&
memcmp(haystack + haystack_length - needle_length,
needle, needle_length) == 0;
std::memcmp(haystack + haystack_length - needle_length,
needle, needle_length) == 0;
}
bool
......@@ -63,7 +63,7 @@ FindStringSuffix(const char *p, const char *suffix) noexcept
return nullptr;
const char *q = p + p_length - suffix_length;
return memcmp(q, suffix, suffix_length) == 0
return std::memcmp(q, suffix, suffix_length) == 0
? q
: nullptr;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment