According to the C99 standard, section 7.21.4.4, ยง3., it is legal:
The
strncmpfunction returns an integer greater than, equal to, or less than zero, accordingly as the possibly null-terminated array pointed to bys1is greater than, equal to, or less than the possibly null-terminated array pointed to bys2.
Notice, however, that it says array of characters. By definition, if an array of characters is not null-terminated, it is not a string.