chiark / gitweb /
[PATCH] - format char for CALLOUT output
[elogind.git] / klibc_fixups.c
1
2 #ifdef __KLIBC__
3
4 #include <stdlib.h>
5 #include <string.h>
6 #include <ctype.h>
7 #include <sys/types.h>
8 #include "klibc_fixups.h"
9
10 char *strerror(int errnum)
11 {
12         return "some error";
13 }
14
15 int strcasecmp(const char *s1, const char *s2)
16 {
17         char *n1;
18         char *n2;
19         int retval;
20         int i;
21
22         n1 = strdup(s1);
23         n2 = strdup(s2);
24         
25         for (i = 0; i < strlen(n1); ++i)
26                 n1[i] = toupper(n1[i]);
27         for (i = 0; i < strlen(n2); ++i)
28                 n2[i] = toupper(n2[i]);
29         retval = strcmp(n1, n2);
30         free(n1);
31         free(n2);
32         return retval;
33 }
34
35 #endif