shithub: scc

ref: 620493c9bdc92f1d4309f1b6bbf9c23f2000aecb
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;
}