From c25d0f6997df75d73264a5d6de71cdeee3ba40d7 Mon Sep 17 00:00:00 2001 From: Jochen Roderburg Date: Sat, 6 Aug 2011 23:28:42 +0200 Subject: [PATCH] Ensure it doesn't print more IPs than available ones. --- src/ChangeLog | 5 +++++ src/host.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1b42b020..d7934d72 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-08-06 Jochen Roderburg + + * host.c (lookup_host): Ensure it doesn't print more IPs than available + ones. + 2011-08-06 Giuseppe Scrivano * init.c (defaults): Set default value for show_all_dns_entries. diff --git a/src/host.c b/src/host.c index 505f706c..86f107a3 100644 --- a/src/host.c +++ b/src/host.c @@ -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++) {