decompile strchr

This commit is contained in:
Alejandro Javier Asenjo Nitti 2023-10-16 13:54:00 -03:00
parent e5ef31fe37
commit 73e7e36375

View File

@ -25,4 +25,15 @@ size_t strlen(const char* s) {
}
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/libc/string/strchr.s")
const char* strchr(const char* s, int c) {
const unsigned char ch = c;
while (*s != ch) {
if (*s == '\0') {
return NULL;
}
s++;
}
return s;
}