blob: e1b476c16fd7bee9f0f05e4029cff4ed14483e27 (
plain)
1
2
3
4
5
6
7
8
9
|
// See LICENSE for license details.
#include <stddef.h>
int strncmp(const char *s1, const char *s2, size_t n)
{
while (n-- > 0 && *s1 && *s2 && *s1 == *s2) { s1++; s2++; }
return *s1 - *s2;
}
|