From 2a25cee78ab1d37e7d2bc40ae675646974d99f56 Mon Sep 17 00:00:00 2001 From: delphij Date: Wed, 15 Jul 2015 19:21:26 +0000 Subject: MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542, 284864,285169-285170,285435: ntp 4.2.8p3. Relnotes: yes Approved by: re (?) --- contrib/ntp/sntp/libopts/compat/strchr.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'contrib/ntp/sntp/libopts/compat/strchr.c') diff --git a/contrib/ntp/sntp/libopts/compat/strchr.c b/contrib/ntp/sntp/libopts/compat/strchr.c index 413f999..f409387 100644 --- a/contrib/ntp/sntp/libopts/compat/strchr.c +++ b/contrib/ntp/sntp/libopts/compat/strchr.c @@ -24,11 +24,17 @@ SVID 3, POSIX, BSD 4.3, ISO 9899 */ -char* -strchr( char const *s, int c) +static char * +strchr(char const *s, int c); + +static char * +strrchr(char const *s, int c); + +static char * +strchr(char const *s, int c) { do { - if ((unsigned)*s == (unsigned)c) + if ((unsigned char)*s == (unsigned char)c) return s; } while (*(++s) != NUL); @@ -36,8 +42,8 @@ strchr( char const *s, int c) return NULL; } -char* -strrchr( char const *s, int c) +static char * +strrchr(char const *s, int c) { char const *e = s + strlen(s); @@ -45,7 +51,7 @@ strrchr( char const *s, int c) if (--e < s) break; - if ((unsigned)*e == (unsigned)c) + if ((unsigned char)*e == (unsigned char)c) return e; } return NULL; -- cgit v1.1