Implemented fclose() and strrchr()

This commit is contained in:
Max Wash
2020-07-18 17:22:20 +01:00
parent 89e40d126b
commit 17ce639206
4 changed files with 41 additions and 0 deletions

View 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;
}