forked from KolibriOS/kolibrios
Added several functions (to ctype.h, stdlib.h)
"Optimised" some functions in string.h Added dynamic libraries support based on sysfunction 68.19 (experimental) git-svn-id: svn://kolibrios.org@215 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
int strncmp(const char* string1, const char* string2, int count)
|
||||
{
|
||||
while(count>0)
|
||||
while(count>0 && *string1==*string2)
|
||||
{
|
||||
if (*string1<*string2)
|
||||
return -1;
|
||||
if (*string1>*string2)
|
||||
return 1;
|
||||
if (*string1=='\0')
|
||||
return 0;
|
||||
count--;
|
||||
}
|
||||
if (*string1) return 0;
|
||||
++string1;
|
||||
++string2;
|
||||
--count;
|
||||
}
|
||||
if(count) return (*string1 - *string2);
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user