cherry pick device tree modifications from isa/arm64
[lunaix-os.git] / lunaix-os / libs / klibc / string / strcmp.c
1 #include <klibc/string.h>
2 #include <lunaix/compiler.h>
3
4 int weak
5 streq(const char* a, const char* b)
6 {
7     while (*a == *b) {
8         if (!(*a)) {
9             return 1;
10         }
11         a++;
12         b++;
13     }
14     return 0;
15 }
16
17 int
18 strneq(const char* a, const char* b, unsigned long n)
19 {
20     while (n-- && *a == *b) {
21         if (!(*a)) {
22             return 1;
23         }
24
25         a++;
26         b++;
27     }
28     return !(n + 1);
29 }