if (strcasecmp(media[i].name, s) == 0) break;
if (s && strcasecmp(media[i].name, s) == 0) break;
static int parse_media(char *arg){    int mask, i;    char *s;    mask = strtoul(arg, &s, 16);    if ((*arg != '\0') && (*s == '\0')) {	if ((mask & MII_AN_ABILITY_MASK) &&	    !(mask & ~MII_AN_ABILITY_MASK))	    return mask;	goto failed;    } else {	mask = 0;	s = strtok(arg, ", ");	do {	    for (i = 0; i < NMEDIA; i++)		if (strcasecmp(media[i].name, s) == 0) break;	    if (i == NMEDIA) goto failed;	    mask |= media[i].value;	} while ((s = strtok(NULL, ", ")) != NULL);    }    return mask;failed:    fprintf(stderr, "Invalid media specification '%s'.\n", arg);    return -1;}