diff options
| author | Rasmus Villemoes <[email protected]> | 2026-07-08 22:37:03 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-07-21 13:51:06 -0600 |
| commit | 210fedfcfc1a146faac67dddb3581c6b9dcd01b4 (patch) | |
| tree | fa621f35aa80c928ab2e205297ef8e0f6cecb0f6 /lib | |
| parent | dabdb361633d93fd753157273a605a44bd5db557 (diff) | |
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 <[email protected]>
Signed-off-by: Rasmus Villemoes <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/string.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/string.c b/lib/string.c index 37ea8c29561..a76dcd48d20 100644 --- a/lib/string.c +++ b/lib/string.c @@ -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 |
