diff --git a/str.c b/str.c index 28202638..aa235cfc 100644 --- a/str.c +++ b/str.c @@ -88,7 +88,7 @@ char *str_toupper_inplace(char *str) return str; } -int strnchr(const char *s, size_t n, char c) +const char *strnchr(const char *s, size_t n, char c) { for (; n; --n, ++s) { if (*s == c) diff --git a/str.h b/str.h index c94fef1b..9c8f15e0 100644 --- a/str.h +++ b/str.h @@ -91,7 +91,7 @@ size_t str_fromprint(unsigned char *dst, const char *src); * * @author Andrew Bettison */ -int strnchr(const char *s, size_t n, char c); +const char *strnchr(const char *s, size_t n, char c); /* Check if a given nul-terminated string 'str' starts with a given nul-terminated sub-string. If * so, return 1 and, if afterp is not NULL, set *afterp to point to the character in 'str'