mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
Fix compiler warning: out of bound access
This commit is contained in:
parent
c9188e2260
commit
bef1b140e9
@ -612,9 +612,14 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
|||||||
printf("Name for country-number %d not found.\n", cnumber);
|
printf("Name for country-number %d not found.\n", cnumber);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ver_1 && *(unsigned short*)&country->short_name != *(unsigned*)&ccode_A2)
|
if (ver_1)
|
||||||
printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2);
|
{
|
||||||
|
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",
|
printf("%s (%s), number %d.\n",
|
||||||
country->long_name, country->short_name, cnumber);
|
country->long_name, country->short_name, cnumber);
|
||||||
}
|
}
|
||||||
|
15
ares/adig.c
15
ares/adig.c
@ -219,9 +219,10 @@ int main(int argc, char **argv)
|
|||||||
if (strcmp(flags[i].name, optarg) == 0)
|
if (strcmp(flags[i].name, optarg) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == nflags)
|
if (i < nflags)
|
||||||
|
options.flags |= flags[i].value;
|
||||||
|
else
|
||||||
usage();
|
usage();
|
||||||
options.flags |= flags[i].value;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
@ -256,9 +257,10 @@ int main(int argc, char **argv)
|
|||||||
if (strcasecmp(classes[i].name, optarg) == 0)
|
if (strcasecmp(classes[i].name, optarg) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == nclasses)
|
if (i < nclasses)
|
||||||
|
dnsclass = classes[i].value;
|
||||||
|
else
|
||||||
usage();
|
usage();
|
||||||
dnsclass = classes[i].value;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
@ -268,9 +270,10 @@ int main(int argc, char **argv)
|
|||||||
if (strcasecmp(types[i].name, optarg) == 0)
|
if (strcasecmp(types[i].name, optarg) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == ntypes)
|
if (i < ntypes)
|
||||||
|
type = types[i].value;
|
||||||
|
else
|
||||||
usage();
|
usage();
|
||||||
type = types[i].value;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user