Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
linux-arm
kvm-unit-tests-ae
Commits
69da6c87
Commit
69da6c87
authored
Dec 19, 2010
by
Avi Kivity
Browse files
lib: add strcmp() implementation
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
a4b87a16
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/libcflat.h
View file @
69da6c87
...
...
@@ -42,6 +42,7 @@ extern void panic(char *fmt, ...);
extern
unsigned
long
strlen
(
const
char
*
buf
);
extern
char
*
strcat
(
char
*
dest
,
const
char
*
src
);
extern
int
strcmp
(
const
char
*
a
,
const
char
*
b
);
extern
int
printf
(
const
char
*
fmt
,
...);
extern
int
vsnprintf
(
char
*
buf
,
int
size
,
const
char
*
fmt
,
va_list
va
);
...
...
lib/string.c
View file @
69da6c87
...
...
@@ -20,6 +20,17 @@ char *strcat(char *dest, const char *src)
return
dest
;
}
int
strcmp
(
const
char
*
a
,
const
char
*
b
)
{
while
(
*
a
==
*
b
)
{
if
(
*
a
==
'\0'
)
{
break
;
}
++
a
,
++
b
;
}
return
*
a
-
*
b
;
}
void
*
memset
(
void
*
s
,
int
c
,
size_t
n
)
{
size_t
i
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment