Commit 69da6c87 authored by Avi Kivity's avatar Avi Kivity
Browse files

lib: add strcmp() implementation


Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent a4b87a16
......@@ -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);
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment