Commit bb7f7bd3 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/StringAPI: add strncmp() wrapper

parent ad2b8589
/*
* Copyright 2010-2018 Max Kellermann <max.kellermann@gmail.com>
* Copyright 2010-2019 Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -134,6 +134,13 @@ StringCompare(const char *a, const char *b) noexcept
return strcmp(a, b);
}
gcc_pure gcc_nonnull_all
static inline int
StringCompare(const char *a, const char *b, size_t n) noexcept
{
return strncmp(a, b, n);
}
/**
* Checks whether #a and #b are equal.
*/
......
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