Use strncmp() here. strstr() is potentially O(n*m).