mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 08:34:20 +08:00
ARM: boot: add strrchr function
libfdt gained a new dependency on strrchr, so copy the implementation from lib/string.c. Cc: Russell King <linux@armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
parent
f26e93812a
commit
60c03a0448
@ -121,6 +121,16 @@ char *strchr(const char *s, int c)
|
||||
return (char *)s;
|
||||
}
|
||||
|
||||
char *strrchr(const char *s, int c)
|
||||
{
|
||||
const char *last = NULL;
|
||||
do {
|
||||
if (*s == (char)c)
|
||||
last = s;
|
||||
} while (*s++);
|
||||
return (char *)last;
|
||||
}
|
||||
|
||||
#undef memset
|
||||
|
||||
void *memset(void *s, int c, size_t count)
|
||||
|
Loading…
Reference in New Issue
Block a user