64be5cdf904e56e4f1ef8a0c6e8cd31c6cfd7f9e
[reactos.git] / lib / msvcrt / string / strrchr.c
1 /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
2 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
3 #include <msvcrt/string.h>
4
5 char *
6 strrchr(const char *s, int c)
7 {
8   char cc = c;
9   const char *sp=(char *)0;
10   while (*s)
11   {
12     if (*s == cc)
13       sp = s;
14     s++;
15   }
16   if (cc == 0)
17     sp = s;
18   return (char *)sp;
19 }
20