From b608b55786a8cecf626d7c489496ac402098b198 Mon Sep 17 00:00:00 2001 From: Alan Brault Date: Tue, 3 May 2011 09:28:09 -0400 Subject: Clean up compat, bring in strcasestr from OpenBSD and strchrnul from uclibc and separate the headers. --- compat/strchrnul.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'compat/strchrnul.c') diff --git a/compat/strchrnul.c b/compat/strchrnul.c index ffc4f85..4781281 100644 --- a/compat/strchrnul.c +++ b/compat/strchrnul.c @@ -18,9 +18,9 @@ * along with duser. If not, see . **/ -#include +#include #include -#include +#include "strchrnul.h" /* * Locate a char in a string @@ -35,10 +35,12 @@ * if c is not found in s, then it returns a pointer to the * null byte at the end of s, rather than NULL. */ -char *strchrnul(const char* s, int c) +char * +strchrnul (const char *s, int c_in) { - while(*s && *s != c) - { - s++; - } + char c = c_in; + while (*s && (*s != c)) + s++; + + return (char *) s; } -- cgit