replace 'strncmp' with 'str[0] == '\0'