printf("Name for country-number %d not found.\n", cnumber);
else
{
- if (ver_1 && *(unsigned short*)&country->short_name != *(unsigned*)&ccode_A2)
- printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2);
-
+ if (ver_1)
+ {
+ if ((country->short_name[0] != ccode_A2[0]) ||
+ (country->short_name[1] != ccode_A2[1]) ||
+ (country->short_name[2] != ccode_A2[2]))
+ printf("short-name mismatch; %s vs %s\n",
+ country->short_name, ccode_A2);
+ }
printf("%s (%s), number %d.\n",
country->long_name, country->short_name, cnumber);
}
if (strcmp(flags[i].name, optarg) == 0)
break;
}
- if (i == nflags)
+ if (i < nflags)
+ options.flags |= flags[i].value;
+ else
usage();
- options.flags |= flags[i].value;
break;
case 's':
if (strcasecmp(classes[i].name, optarg) == 0)
break;
}
- if (i == nclasses)
+ if (i < nclasses)
+ dnsclass = classes[i].value;
+ else
usage();
- dnsclass = classes[i].value;
break;
case 't':
if (strcasecmp(types[i].name, optarg) == 0)
break;
}
- if (i == ntypes)
+ if (i < ntypes)
+ type = types[i].value;
+ else
usage();
- type = types[i].value;
break;
case 'T':