shithub: scc

ref: 823acc68023d0d810d7d830f13da713625bc51f4
dir: /lib/c/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;
}