git://scm.lunaixsky.com
/
lunaix-os.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
rewrite the device subsystem interfaces (#48)
[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
}