string: correct prototype of strchrnul()
Both glibc's (where this originated as a GNU extension) and the kernel's versions of strchrnul() return "char *", not "const char *". That also makes it consistent with the standard strchr() function. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
This commit is contained in:
committed by
Tom Rini
parent
dabdb36163
commit
210fedfcfc
@@ -63,7 +63,7 @@ extern char * strchr(const char *,int);
|
||||
* @c: character to search for
|
||||
* Return: position of @c in @s, or end of @s if not found
|
||||
*/
|
||||
const char *strchrnul(const char *s, int c);
|
||||
char *strchrnul(const char *s, int c);
|
||||
|
||||
#ifndef __HAVE_ARCH_STRRCHR
|
||||
extern char * strrchr(const char *,int);
|
||||
|
||||
+2
-2
@@ -263,12 +263,12 @@ char * strchr(const char * s, int c)
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *strchrnul(const char *s, int c)
|
||||
char *strchrnul(const char *s, int c)
|
||||
{
|
||||
for (; *s != (char)c; ++s)
|
||||
if (*s == '\0')
|
||||
break;
|
||||
return s;
|
||||
return (char *)s;
|
||||
}
|
||||
|
||||
#ifndef __HAVE_ARCH_STRRCHR
|
||||
|
||||
Reference in New Issue
Block a user