читаю:
http://www.cplusplus.com/reference/clibrary/cstring/strncmp/
Compares up to num characters of the C string str1 to those of the C string str2.
This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ, until a terminating null-character is reached, or until num characters match in both strings, whichever happens first.
То либо первая либо вторая строка заканчивается 0
но смотрю исходники от IAR и там проверка только первой строки, да и порядок проверки не тот. Где истина ?
int strncmp(const char *s1, const char *s2, size_t n)
{ /* compare unsigned char s1[max n], s2[max n] */
for (; 0 < n; ++s1, ++s2, --n)
if (*s1 != *s2)
return ( *(unsigned char *)s1
< *(unsigned char *)s2 ? -1 : +1);
else if (*s1 == '\0')
return (0);
return (0);
}