Skip to content

Commit

Permalink
Change recommendation of strchrnul in strchr documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Bauzac authored and Joseph Myers committed Feb 17, 2012
1 parent 3f4081c commit 0520add
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2012-02-17 Fabrice Bauzac <fabrice.bauzac@wanadoo.fr>

[BZ #6907]
* manual/string.texi (strchr): Change when strchrnul is
recommended.

2012-02-17 Dwayne Grant McConnell <decimal@us.ibm.com>

[BZ #174]
Expand Down
6 changes: 3 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Version 2.16

* The following bugs are resolved with this release:

174, 350, 411, 3335, 4026, 4822, 5805, 6884, 9902, 10140, 10210, 11494,
12047, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533,
13547, 13551, 13552, 13553, 13555, 13559, 13583, 13618
174, 350, 411, 3335, 4026, 4822, 5805, 6884, 6907, 9902, 10140, 10210,
11494, 12047, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532,
13533, 13547, 13551, 13552, 13553, 13555, 13559, 13583, 13618

* ISO C11 support:

Expand Down
9 changes: 6 additions & 3 deletions manual/string.texi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0520add

Please sign in to comment.