aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot/string.c')
-rw-r--r--arch/x86/boot/string.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 9e240fcba784..5457b02fc050 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -156,3 +156,16 @@ char *strstr(const char *s1, const char *s2)
}
return NULL;
}
+
+/**
+ * strchr - Find the first occurrence of the character c in the string s.
+ * @s: the string to be searched
+ * @c: the character to search for
+ */
+char *strchr(const char *s, int c)
+{
+ while (*s != (char)c)
+ if (*s++ == '\0')
+ return NULL;
+ return (char *)s;
+}