aboutsummaryrefslogtreecommitdiff
path: root/compat/strchrnul.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/strchrnul.c')
-rw-r--r--compat/strchrnul.c15
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;
}