summaryrefslogtreecommitdiff
path: root/firmware/common/strcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/strcmp.c')
-rw-r--r--firmware/common/strcmp.c42
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/*
2FUNCTION 2FUNCTION
3 <<strcmp>>---character string compare 3 <<strcmp>>---character string compare
4 4
5INDEX 5INDEX
6 strcmp 6 strcmp
7 7
8ANSI_SYNOPSIS 8ANSI_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
12TRAD_SYNOPSIS 12TRAD_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
18DESCRIPTION 18DESCRIPTION
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
22RETURNS 22RETURNS
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
29PORTABILITY 29PORTABILITY
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
34QUICKREF 34QUICKREF
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
60int 60int
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++;