strncmp confronta stringhe null terminated, mentre tu gli passi dei caratteri.