shithub: scc

ref: 6ce3c0bd14348efbe61ecb6b02c89d62fa1847e4
dir: /lib/c/src/strrchr.c/

View raw version
#include <string.h>
#undef strrchr

char *
strrchr(const char *s, int c)
{
	const char *t = s;

	while (*t)
		++t;
	while (t > s && *t != c)
		--t;
	return (*t == c) ? (char *)t : NULL;
}