fixed strncmp implementation