mirror of
https://github.com/Fennix-Project/Userspace.git
synced 2025-08-25 12:55:03 +00:00
15 lines
266 B
C
15 lines
266 B
C
#include <string.h>
|
|
|
|
int strncmp(const char *s1, const char *s2, size_t n)
|
|
{
|
|
for (size_t i = 0; i < n; i++)
|
|
{
|
|
char c1 = s1[i], c2 = s2[i];
|
|
if (c1 != c2)
|
|
return c1 - c2;
|
|
if (!c1)
|
|
return 0;
|
|
}
|
|
return 0;
|
|
}
|