2016-05-19 14:15:22 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int strncmp(const char* string1, const char* string2, size_t count)
|
2006-09-07 16:14:53 +02:00
|
|
|
{
|
2016-05-19 14:15:22 +02:00
|
|
|
while(count>0 && (*string1==*string2))
|
2006-09-07 16:14:53 +02:00
|
|
|
{
|
2016-05-19 14:15:22 +02:00
|
|
|
if ('\0' == *string1) return 0;
|
2006-11-21 13:36:25 +01:00
|
|
|
++string1;
|
|
|
|
++string2;
|
|
|
|
--count;
|
|
|
|
}
|
|
|
|
if(count) return (*string1 - *string2);
|
2006-09-07 16:14:53 +02:00
|
|
|
return 0;
|
2016-05-19 14:15:22 +02:00
|
|
|
}
|