From 0520adde6b06d750067cbdf46b1fb9d098b33a95 Mon Sep 17 00:00:00 2001 From: Fabrice Bauzac Date: Fri, 17 Feb 2012 23:34:01 +0000 Subject: Change recommendation of strchrnul in strchr documentation. --- manual/string.texi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'manual') diff --git a/manual/string.texi b/manual/string.texi index f7d4ebea1d..abfb0798b9 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -1647,9 +1647,12 @@ strchr ("hello, world", '?') The terminating null character is considered to be part of the string, so you can use this function get a pointer to the end of a string by -specifying a null character as the value of the @var{c} argument. It -would be better (but less portable) to use @code{strchrnul} in this -case, though. +specifying a null character as the value of the @var{c} argument. + +When @code{strchr} returns a null pointer, it does not let you know +the position of the terminating null character it has found. If you +need that information, it is better (but less portable) to use +@code{strchrnul} than to search for it a second time. @end deftypefun @comment wchar.h -- cgit v1.2.1