diff options
Diffstat (limited to 'firmware/common/strcmp.c')
-rw-r--r-- | firmware/common/strcmp.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/firmware/common/strcmp.c b/firmware/common/strcmp.c index 81d65272ec..bbbf4b174a 100644 --- a/firmware/common/strcmp.c +++ b/firmware/common/strcmp.c | |||
@@ -1,30 +1,30 @@ | |||
1 | /* | 1 | /* |
2 | FUNCTION | 2 | FUNCTION |
3 | <<strcmp>>---character string compare | 3 | <<strcmp>>---character string compare |
4 | 4 | ||
5 | INDEX | 5 | INDEX |
6 | strcmp | 6 | strcmp |
7 | 7 | ||
8 | ANSI_SYNOPSIS | 8 | ANSI_SYNOPSIS |
9 | #include <string.h> | 9 | #include <string.h> |
10 | int strcmp(const char *<[a]>, const char *<[b]>); | 10 | int strcmp(const char *<[a]>, const char *<[b]>); |
11 | 11 | ||
12 | TRAD_SYNOPSIS | 12 | TRAD_SYNOPSIS |
13 | #include <string.h> | 13 | #include <string.h> |
14 | int strcmp(<[a]>, <[b]>) | 14 | int strcmp(<[a]>, <[b]>) |
15 | char *<[a]>; | 15 | char *<[a]>; |
16 | char *<[b]>; | 16 | char *<[b]>; |
17 | 17 | ||
18 | DESCRIPTION | 18 | DESCRIPTION |
19 | <<strcmp>> compares the string at <[a]> to | 19 | <<strcmp>> compares the string at <[a]> to |
20 | the string at <[b]>. | 20 | the string at <[b]>. |
21 | 21 | ||
22 | RETURNS | 22 | RETURNS |
23 | If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>, | 23 | If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>, |
24 | <<strcmp>> returns a number greater than zero. If the two | 24 | <<strcmp>> returns a number greater than zero. If the two |
25 | strings match, <<strcmp>> returns zero. If <<*<[a]>>> | 25 | strings match, <<strcmp>> returns zero. If <<*<[a]>>> |
26 | sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a | 26 | sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a |
27 | number less than zero. | 27 | number less than zero. |
28 | 28 | ||
29 | PORTABILITY | 29 | PORTABILITY |
30 | <<strcmp>> is ANSI C. | 30 | <<strcmp>> is ANSI C. |
@@ -32,7 +32,7 @@ PORTABILITY | |||
32 | <<strcmp>> requires no supporting OS subroutines. | 32 | <<strcmp>> requires no supporting OS subroutines. |
33 | 33 | ||
34 | QUICKREF | 34 | QUICKREF |
35 | strcmp ansi pure | 35 | strcmp ansi pure |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include <string.h> | 38 | #include <string.h> |
@@ -59,8 +59,8 @@ QUICKREF | |||
59 | 59 | ||
60 | int | 60 | int |
61 | _DEFUN (strcmp, (s1, s2), | 61 | _DEFUN (strcmp, (s1, s2), |
62 | _CONST char *s1 _AND | 62 | _CONST char *s1 _AND |
63 | _CONST char *s2) | 63 | _CONST char *s2) |
64 | { | 64 | { |
65 | #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) | 65 | #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) |
66 | while (*s1 != '\0' && *s1 == *s2) | 66 | while (*s1 != '\0' && *s1 == *s2) |
@@ -83,9 +83,9 @@ _DEFUN (strcmp, (s1, s2), | |||
83 | while (*a1 == *a2) | 83 | while (*a1 == *a2) |
84 | { | 84 | { |
85 | /* To get here, *a1 == *a2, thus if we find a null in *a1, | 85 | /* To get here, *a1 == *a2, thus if we find a null in *a1, |
86 | then the strings must be equal, so return zero. */ | 86 | then the strings must be equal, so return zero. */ |
87 | if (DETECTNULL (*a1)) | 87 | if (DETECTNULL (*a1)) |
88 | return 0; | 88 | return 0; |
89 | 89 | ||
90 | a1++; | 90 | a1++; |
91 | a2++; | 91 | a2++; |