.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" Linux libc source code
.\" 2006-05-19, Justin Pryzby <pryzbyj@justinpryzby.com>
.\" Document strchrnul(3).
.\"
-.TH STRCHR 3 2010-09-20 "GNU" "Linux Programmer's Manual"
+.TH STRCHR 3 2014-01-20 "GNU" "Linux Programmer's Manual"
.SH NAME
strchr, strrchr, strchrnul \- locate character in string
.SH SYNOPSIS
The
.BR strchr ()
function returns a pointer to the first occurrence
-of the character \fIc\fP in the string \fIs\fP.
+of the character
+.I c
+in the string
+.IR s .
.PP
The
.BR strrchr ()
function returns a pointer to the last occurrence
-of the character \fIc\fP in the string \fIs\fP.
+of the character
+.I c
+in the string
+.IR s .
.PP
The
.BR strchrnul ()
function is like
.BR strchr ()
-except that if \fIc\fP is not found in \fIs\fP,
+except that if
+.I c
+is not found in
+.IR s ,
then it returns a pointer to the null byte
-at the end of \fIs\fP, rather than NULL.
+at the end of
+.IR s ,
+rather than NULL.
.PP
Here "character" means "byte"; these functions do not work with
wide or multibyte characters.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
The
.BR strchr ()
and
.BR strrchr ()
functions return a pointer to
the matched character or NULL if the character is not found.
+The terminating null byte is considered part of the string,
+so that if
+.I c
+is specified as \(aq\\0\(aq,
+these functions return a pointer to the terminator.
The
.BR strchrnul ()
function returns a pointer to
the matched character,
or a pointer to the null
-byte at the end of \fIs\fP (i.e., \fIs+strlen(s)\fP)
+byte at the end of
+.I s
+(i.e.,
+.IR "s+strlen(s)" )
if the character is not found.
.SH VERSIONS
.BR strchrnul ()
first appeared in glibc in version 2.1.1.
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR strchr (),
+.BR strrchr (),
+and
+.BR strchrnul ()
+functions are thread-safe.
+.SH CONFORMING TO
.BR strchr ()
and
.BR strrchr ()
are in SVr4, 4.3BSD, C89, C99.
.BR strchrnul ()
is a GNU extension.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR index (3),
.BR memchr (3),
.BR rindex (3),
.BR strtok (3),
.BR wcschr (3),
.BR wcsrchr (3)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.