summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/sntp/libopts/compat/strchr.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-07-15 19:21:26 +0000
committerdelphij <delphij@FreeBSD.org>2015-07-15 19:21:26 +0000
commit2a25cee78ab1d37e7d2bc40ae675646974d99f56 (patch)
treeb0302ac4be59e104f4e1e54014561a1389397192 /contrib/ntp/sntp/libopts/compat/strchr.c
parenta0741a75537b2e0514472ac3b28afc55a7846c30 (diff)
downloadFreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.zip
FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.tar.gz
MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542,
284864,285169-285170,285435: ntp 4.2.8p3. Relnotes: yes Approved by: re (?)
Diffstat (limited to 'contrib/ntp/sntp/libopts/compat/strchr.c')
-rw-r--r--contrib/ntp/sntp/libopts/compat/strchr.c18
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 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;
OpenPOWER on IntegriCloud