mirror of
https://xff.cz/git/u-boot/
synced 2025-10-16 07:21:26 +02:00
string: Add strchrnul()
This functions works like strchr() but returns the end of the string if the character is not found. Add an implementation of this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -230,6 +230,14 @@ char * strchr(const char * s, int c)
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *strchrnul(const char *s, int c)
|
||||
{
|
||||
for (; *s != (char)c; ++s)
|
||||
if (*s == '\0')
|
||||
break;
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifndef __HAVE_ARCH_STRRCHR
|
||||
/**
|
||||
* strrchr - Find the last occurrence of a character in a string
|
||||
|
Reference in New Issue
Block a user