Fix wrong declaration of strnchr()

This commit is contained in:
Andrew Bettison 2013-02-27 18:10:39 +10:30
parent 4648f5096a
commit 133c34325f
2 changed files with 2 additions and 2 deletions

2
str.c
View File

@ -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)

2
str.h
View File

@ -91,7 +91,7 @@ size_t str_fromprint(unsigned char *dst, const char *src);
*
* @author Andrew Bettison <andrew@servalproject.com>
*/
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'