diff options
author | Alan Brault <alan.brault@incruentatus.net> | 2011-05-02 18:58:40 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunk@stsci.edu> | 2012-05-25 14:21:08 -0400 |
commit | 0b20b98e9b2e87eb2e9e10f658d2d523b0ee9fb6 (patch) | |
tree | 942d28cad437dd20bf29cb60ad58ad4949b87c96 /compat/strchrnul.c | |
parent | db970762d90a3adda07874ac597928f5305b0a49 (diff) | |
download | duser-0b20b98e9b2e87eb2e9e10f658d2d523b0ee9fb6.tar.gz |
Remove strcasestr() and strchrnul() checks from configure, using libdusercompat.a instead
Fix Makefile.am bad entry
Clean up compat, bring in strcasestr from OpenBSD and strchrnul from uclibc
and separate the headers.
Remove config.h from strchrnul.c; not needed
Fix numerous shadow declaration bugs that could cause problems for Solaris libc
Fix bad prototype using in unlink()
Diffstat (limited to 'compat/strchrnul.c')
-rw-r--r-- | compat/strchrnul.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compat/strchrnul.c b/compat/strchrnul.c index ffc4f85..da8898b 100644 --- a/compat/strchrnul.c +++ b/compat/strchrnul.c @@ -18,9 +18,8 @@ * along with duser. If not, see <http://www.gnu.org/licenses/>. **/ -#include <stdio.h> #include <string.h> -#include <ctype.h> +#include "strchrnul.h" /* * Locate a char in a string @@ -35,10 +34,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; } |