meta: move photon/libc to root
This commit is contained in:
15
libc/string/strrchr.c
Normal file
15
libc/string/strrchr.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <string.h>
|
||||
|
||||
char *strrchr(const char *s, int c)
|
||||
{
|
||||
/* include null term */
|
||||
long sz = strlen(s) + 1;
|
||||
|
||||
for (long i = sz; i >= 0; i--) {
|
||||
if (s[i] == c) {
|
||||
return (char *)(s + i);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user