diff options
Diffstat (limited to 'firmware/common/strrchr.c')
-rw-r--r-- | firmware/common/strrchr.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/firmware/common/strrchr.c b/firmware/common/strrchr.c index 4f903afe2b..31b0d049b3 100644 --- a/firmware/common/strrchr.c +++ b/firmware/common/strrchr.c | |||
@@ -1,28 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | FUNCTION | 2 | FUNCTION |
3 | <<strrchr>>---reverse search for character in string | 3 | <<strrchr>>---reverse search for character in string |
4 | 4 | ||
5 | INDEX | 5 | INDEX |
6 | strrchr | 6 | strrchr |
7 | 7 | ||
8 | ANSI_SYNOPSIS | 8 | ANSI_SYNOPSIS |
9 | #include <string.h> | 9 | #include <string.h> |
10 | char * strrchr(const char *<[string]>, int <[c]>); | 10 | char * strrchr(const char *<[string]>, int <[c]>); |
11 | 11 | ||
12 | TRAD_SYNOPSIS | 12 | TRAD_SYNOPSIS |
13 | #include <string.h> | 13 | #include <string.h> |
14 | char * strrchr(<[string]>, <[c]>); | 14 | char * strrchr(<[string]>, <[c]>); |
15 | char *<[string]>; | 15 | char *<[string]>; |
16 | int *<[c]>; | 16 | int *<[c]>; |
17 | 17 | ||
18 | DESCRIPTION | 18 | DESCRIPTION |
19 | This function finds the last occurence of <[c]> (converted to | 19 | This function finds the last occurence of <[c]> (converted to |
20 | a char) in the string pointed to by <[string]> (including the | 20 | a char) in the string pointed to by <[string]> (including the |
21 | terminating null character). | 21 | terminating null character). |
22 | 22 | ||
23 | RETURNS | 23 | RETURNS |
24 | Returns a pointer to the located character, or a null pointer | 24 | Returns a pointer to the located character, or a null pointer |
25 | if <[c]> does not occur in <[string]>. | 25 | if <[c]> does not occur in <[string]>. |
26 | 26 | ||
27 | PORTABILITY | 27 | PORTABILITY |
28 | <<strrchr>> is ANSI C. | 28 | <<strrchr>> is ANSI C. |
@@ -30,30 +30,30 @@ PORTABILITY | |||
30 | <<strrchr>> requires no supporting OS subroutines. | 30 | <<strrchr>> requires no supporting OS subroutines. |
31 | 31 | ||
32 | QUICKREF | 32 | QUICKREF |
33 | strrchr ansi pure | 33 | strrchr ansi pure |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include <string.h> | 36 | #include <string.h> |
37 | 37 | ||
38 | char * | 38 | char * |
39 | _DEFUN (strrchr, (s, i), | 39 | _DEFUN (strrchr, (s, i), |
40 | _CONST char *s _AND | 40 | _CONST char *s _AND |
41 | int i) | 41 | int i) |
42 | { | 42 | { |
43 | _CONST char *last = NULL; | 43 | _CONST char *last = NULL; |
44 | 44 | ||
45 | if (i) | 45 | if (i) |
46 | { | 46 | { |
47 | while ((s=strchr(s, i))) | 47 | while ((s=strchr(s, i))) |
48 | { | 48 | { |
49 | last = s; | 49 | last = s; |
50 | s++; | 50 | s++; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | else | 53 | else |
54 | { | 54 | { |
55 | last = strchr(s, i); | 55 | last = strchr(s, i); |
56 | } | 56 | } |
57 | 57 | ||
58 | return (char *) last; | 58 | return (char *) last; |
59 | } | 59 | } |