nand, nandfs and crypto code for miniios

i blame lack of sleep for ugly code.
This commit is contained in:
Sven Peter
2009-01-17 15:05:13 +01:00
committed by bushing
parent a02074a8ae
commit 51fd48f066
12 changed files with 669 additions and 3 deletions

View File

@@ -58,6 +58,18 @@ int strcmp(const char *p, const char *q)
}
}
int strncmp(const char *p, const char *q, size_t n)
{
while (n-- != 0) {
unsigned char a, b;
a = *p++;
b = *q++;
if (a == 0 || a != b)
return a - b;
}
return 0;
}
void *memset(void *dst, int x, size_t n)
{
unsigned char *p;
@@ -92,3 +104,11 @@ int memcmp(const void *s1, const void *s2, size_t n)
return 0;
}
char *strchr(const char *s, int c)
{
do {
if(*s == c)
return (char *)s;
} while(*s++ != 0);
return NULL;
}