nslookup: fix output corruption for "nslookup 1.2.3.4"

function                                             old     new   delta
nslookup_main                                       1832    1837      +5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-04-14 23:18:34 +02:00
parent cf950cd3ea
commit 4e73c0f659

View File

@ -797,11 +797,9 @@ int nslookup_main(int argc UNUSED_PARAM, char **argv)
char buf80[80];
ptr = make_ptr(buf80, *argv);
if (ptr) {
add_query(&queries, &n_queries, T_PTR, ptr);
}
else {
add_query(&queries, &n_queries, T_PTR, xstrdup(ptr));
} else {
add_query(&queries, &n_queries, T_A, *argv);
#if ENABLE_FEATURE_IPV6
add_query(&queries, &n_queries, T_AAAA, *argv);