shithub: scc

ref: 647f85d6fac7e0aee9881909cd5086941e3d11c7
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;
}