Implemented some basic libc functions and a text console
This commit is contained in:
13
libc/string/strrchr.c
Normal file
13
libc/string/strrchr.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <socks/libc/string.h>
|
||||
|
||||
char *strrchr(const char *str, int c) {
|
||||
size_t len = strlen(str);
|
||||
|
||||
for (int i = len - 1; i > 0; i--) {
|
||||
if (str[i] == c) {
|
||||
return (char *)&str[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user