shithub: scc

ref: d82fe81032115596968f35e60beb85ac5ef69f9c
dir: /src/libc/string/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) ? t : NULL;
}