diff --git a/src/util/StringAPI.hxx b/src/util/StringAPI.hxx index 56b20087f..0d8878442 100644 --- a/src/util/StringAPI.hxx +++ b/src/util/StringAPI.hxx @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 Max Kellermann + * Copyright 2010-2019 Max Kellermann * * 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. */