2006-09-07 16:14:53 +02:00
|
|
|
int strncmp(const char* string1, const char* string2, int count)
|
|
|
|
{
|
2006-11-21 13:36:25 +01:00
|
|
|
while(count>0 && *string1==*string2)
|
2006-09-07 16:14:53 +02:00
|
|
|
{
|
2006-11-21 13:36:25 +01:00
|
|
|
if (*string1) return 0;
|
|
|
|
++string1;
|
|
|
|
++string2;
|
|
|
|
--count;
|
|
|
|
}
|
|
|
|
if(count) return (*string1 - *string2);
|
2006-09-07 16:14:53 +02:00
|
|
|
return 0;
|
2006-11-21 13:36:25 +01:00
|
|
|
}
|