git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewrite the device subsystem interfaces (#48)
[lunaix-os.git]
/
lunaix-os
/
libs
/
klibc
/
string
/
strcmp.c
diff --git
a/lunaix-os/libs/klibc/string/strcmp.c
b/lunaix-os/libs/klibc/string/strcmp.c
index 88759ceb8ad78e5f6a5c2320978273d36ca7b50e..482828776d963e9b38de3dc31db8bfb7a3b3334e 100644
(file)
--- a/
lunaix-os/libs/klibc/string/strcmp.c
+++ b/
lunaix-os/libs/klibc/string/strcmp.c
@@
-1,7
+1,7
@@
#include <klibc/string.h>
#include <lunaix/compiler.h>
#include <klibc/string.h>
#include <lunaix/compiler.h>
-int weak
+int
_
weak
streq(const char* a, const char* b)
{
while (*a == *b) {
streq(const char* a, const char* b)
{
while (*a == *b) {
@@
-12,4
+12,18
@@
streq(const char* a, const char* b)
b++;
}
return 0;
b++;
}
return 0;
+}
+
+int
+strneq(const char* a, const char* b, unsigned long n)
+{
+ while (n-- && *a == *b) {
+ if (!(*a)) {
+ return 1;
+ }
+
+ a++;
+ b++;
+ }
+ return !(n + 1);
}
\ No newline at end of file
}
\ No newline at end of file