Files

16 lines
251 B
C
Raw Permalink Normal View History

2020-07-18 17:22:20 +01:00
#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;
}