ref: c8a370bc13b78bbf98b2d25446d80444991760d1
dir: /libc/src/strrchr.c/
/* See LICENSE file for copyright and license details. */
#include <string.h>
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;
}