* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
#include <config.h>
-#include <compat.h>
-
-#ifndef lint
-__unused static const char rcsid[] = "$Sudo: memrchr.c,v 1.1.2.2 2007/06/19 21:00:35 millert Exp $";
-#endif /* lint */
#include <sys/types.h>
-#include <config.h>
+
+#include "missing.h"
/*
* Reverse memchr()
- * Find the last occurence of 'c' in the buffer 's' of size 'n'.
+ * Find the last occurrence of 'c' in the buffer 's' of size 'n'.
*/
-VOID *
+void *
memrchr(s, c, n)
- const VOID *s;
+ const void *s;
int c;
size_t n;
{
cp = (unsigned char *)s + n;
do {
if (*(--cp) == (unsigned char)c)
- return((VOID *)cp);
+ return (void *)cp;
} while (--n != 0);
}
- return((VOID *)0);
+ return (void *)0;
}