diff options
Diffstat (limited to 'compat/strchrnul.c')
-rw-r--r-- | compat/strchrnul.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 <http://www.gnu.org/licenses/>. **/ -#include <stdio.h> +#include <config.h> #include <string.h> -#include <ctype.h> +#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; } |