diff options
Diffstat (limited to 'src/lib/libc/string')
-rw-r--r-- | src/lib/libc/string/strchr.3 | 5 | ||||
-rw-r--r-- | src/lib/libc/string/strchr.c | 4 | ||||
-rw-r--r-- | src/lib/libc/string/strrchr.3 | 5 | ||||
-rw-r--r-- | src/lib/libc/string/strrchr.c | 4 |
4 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/libc/string/strchr.3 b/src/lib/libc/string/strchr.3 index 854438677a..07e7f29f5b 100644 --- a/src/lib/libc/string/strchr.3 +++ b/src/lib/libc/string/strchr.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: strchr.3,v 1.12 2015/11/24 09:14:35 daniel Exp $ | 1 | .\" $OpenBSD: strchr.3,v 1.13 2018/10/01 06:37:37 martijn Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -31,7 +31,7 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: November 24 2015 $ | 34 | .Dd $Mdocdate: October 1 2018 $ |
35 | .Dt STRCHR 3 | 35 | .Dt STRCHR 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -50,6 +50,7 @@ The | |||
50 | .Fn strchr | 50 | .Fn strchr |
51 | function locates the first occurrence of the character | 51 | function locates the first occurrence of the character |
52 | .Fa c | 52 | .Fa c |
53 | .Pq converted to a char | ||
53 | in the string | 54 | in the string |
54 | .Fa s . | 55 | .Fa s . |
55 | The terminating NUL character is considered part of the string. | 56 | The terminating NUL character is considered part of the string. |
diff --git a/src/lib/libc/string/strchr.c b/src/lib/libc/string/strchr.c index b396b45b3b..8bfa7ac3aa 100644 --- a/src/lib/libc/string/strchr.c +++ b/src/lib/libc/string/strchr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */ | 1 | /* $OpenBSD: strchr.c,v 1.4 2018/10/01 06:37:37 martijn Exp $ */ |
2 | /*- | 2 | /*- |
3 | * Copyright (c) 1990 The Regents of the University of California. | 3 | * Copyright (c) 1990 The Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -36,7 +36,7 @@ char * | |||
36 | strchr(const char *p, int ch) | 36 | strchr(const char *p, int ch) |
37 | { | 37 | { |
38 | for (;; ++p) { | 38 | for (;; ++p) { |
39 | if (*p == ch) | 39 | if (*p == (char) ch) |
40 | return((char *)p); | 40 | return((char *)p); |
41 | if (!*p) | 41 | if (!*p) |
42 | return((char *)NULL); | 42 | return((char *)NULL); |
diff --git a/src/lib/libc/string/strrchr.3 b/src/lib/libc/string/strrchr.3 index f4ce691a6e..5abb88ec70 100644 --- a/src/lib/libc/string/strrchr.3 +++ b/src/lib/libc/string/strrchr.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: strrchr.3,v 1.11 2015/11/24 09:14:35 daniel Exp $ | 1 | .\" $OpenBSD: strrchr.3,v 1.12 2018/10/01 06:37:37 martijn Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -31,7 +31,7 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: November 24 2015 $ | 34 | .Dd $Mdocdate: October 1 2018 $ |
35 | .Dt STRRCHR 3 | 35 | .Dt STRRCHR 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -50,6 +50,7 @@ The | |||
50 | .Fn strrchr | 50 | .Fn strrchr |
51 | function locates the last occurrence of the character | 51 | function locates the last occurrence of the character |
52 | .Fa c | 52 | .Fa c |
53 | .Pq converted to a char | ||
53 | in the string | 54 | in the string |
54 | .Fa s . | 55 | .Fa s . |
55 | The terminating | 56 | The terminating |
diff --git a/src/lib/libc/string/strrchr.c b/src/lib/libc/string/strrchr.c index 9375572144..848d1ad22e 100644 --- a/src/lib/libc/string/strrchr.c +++ b/src/lib/libc/string/strrchr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strrchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */ | 1 | /* $OpenBSD: strrchr.c,v 1.4 2018/10/01 06:37:37 martijn Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1988 Regents of the University of California. | 3 | * Copyright (c) 1988 Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -38,7 +38,7 @@ strrchr(const char *p, int ch) | |||
38 | char *save; | 38 | char *save; |
39 | 39 | ||
40 | for (save = NULL;; ++p) { | 40 | for (save = NULL;; ++p) { |
41 | if (*p == ch) | 41 | if (*p == (char) ch) |
42 | save = (char *)p; | 42 | save = (char *)p; |
43 | if (!*p) | 43 | if (!*p) |
44 | return(save); | 44 | return(save); |