summaryrefslogblamecommitdiff
path: root/src/string/strrchr.c
blob: 31c8e0b8d2108e36cb391111346f6824511bccc9 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                
#include <string.h>

char *strrchr(const char *s, int c)
{
	const char *p;
	c = (char)c;
	for (p=s+strlen(s); p>=s && *p!=c; p--);
	return p>=s ? (char *)p : 0;
}