shithub: scc

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