Ensure it doesn't print more IPs than available ones.

This commit is contained in:
Jochen Roderburg 2011-08-06 23:28:42 +02:00 committed by Giuseppe Scrivano
parent aed17cca14
commit c25d0f6997
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-08-06 Jochen Roderburg <Roderburg@Uni-Koeln.DE>
* host.c (lookup_host): Ensure it doesn't print more IPs than available
ones.
2011-08-06 Giuseppe Scrivano <gscrivano@gnu.org>
* init.c (defaults): Set default value for show_all_dns_entries.

View File

@ -828,8 +828,8 @@ lookup_host (const char *host, int flags)
int i;
int printmax = al->count;
if (! opt.show_all_dns_entries)
printmax = 3;
if (!opt.show_all_dns_entries && printmax > 3)
printmax = 3;
for (i = 0; i < printmax; i++)
{