for (pos = 0; pos < len; pos++) {
if (c1[pos] != c2[pos])
return c1[pos] - c2[pos];
-
- pos++;
}
return 0;
s2++;
}
- return *s2 - *s1;
+ return (unsigned char)*s2 - (unsigned char)*s1;
}
int strncmp(const char *s1, const char *s2, int n)
if (i == n)
return 0;
- return *s2 - *s1;
+ return (unsigned char)s2[i] - (unsigned char)s1[i];
}
char *strchr(const char *s, int c)