shithub: scc

ref: 58b406cf181a732417b57119b9da46836a2b3ada
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;
}