Adding upstream version 3.50~pre5.
[syslinux-debian/hramrach.git] / com32 / lib / strncmp.c
blob4dbde1389f77cce75743192b751e9fecc24f1ba0
1 /*
2 * strncmp.c
3 */
5 #include <string.h>
7 int strncmp(const char *s1, const char *s2, size_t n)
9 const unsigned char *c1 = s1, *c2 = s2;
10 unsigned char ch;
11 int d = 0;
13 while ( n-- ) {
14 d = (int)(ch = *c1++) - (int)*c2++;
15 if ( d || !ch )
16 break;
19 return d;