diff options
Diffstat (limited to 'contrib/ntp/sntp/libopts/compat/strchr.c')
-rw-r--r-- | contrib/ntp/sntp/libopts/compat/strchr.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/ntp/sntp/libopts/compat/strchr.c b/contrib/ntp/sntp/libopts/compat/strchr.c index 413f999ff934..f40938707bbf 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; |