use strncmp instead of our own