BSD 4 development
[unix-history] / usr / src / libc / gen / rindex.c
CommitLineData
9c8fc5ca
BJ
1/*
2 * Return the ptr in sp at which the character c last
3 * appears; NULL if not found
4*/
5
6#define NULL 0
7
8char *
9rindex(sp, c)
10register char *sp, c;
11{
12 register char *r;
13
14 r = NULL;
15 do {
16 if (*sp == c)
17 r = sp;
18 } while (*sp++);
19 return(r);
20}