diff --git a/output.cc b/output.cc index b7384a30c..2a1af742f 100644 --- a/output.cc +++ b/output.cc @@ -1425,10 +1425,14 @@ static char *num_to_string_sigdigits(double d, int digits) { including host status and DNS records. */ void write_host_header(Target *currenths) { if ((currenths->flags & HOST_UP) || o.verbose || o.resolve_all) { - if (currenths->flags & HOST_UP) + if (currenths->flags & HOST_UP) { log_write(LOG_PLAIN, "Nmap scan report for %s\n", currenths->NameIP()); - else if (currenths->flags & HOST_DOWN) - log_write(LOG_PLAIN, "Nmap scan report for %s [host down]\n", currenths->NameIP()); + } else if (currenths->flags & HOST_DOWN) { + log_write(LOG_PLAIN, "Nmap scan report for %s [host down", currenths->NameIP()); + if (o.reason) + log_write(LOG_PLAIN, ", %s", target_reason_str(currenths)); + log_write(LOG_PLAIN, "]\n"); + } } write_host_status(currenths, o.resolve_all); if (currenths->TargetName() != NULL diff --git a/portreasons.cc b/portreasons.cc index 495b19d16..496f2c893 100644 --- a/portreasons.cc +++ b/portreasons.cc @@ -357,7 +357,6 @@ void print_xml_state_summary(PortList *Ports, int state) { char *target_reason_str(Target *t) { static char reason[128]; memset(reason,'\0', 128); - assert(t->reason.reason_id != ER_NORESPONSE); Snprintf(reason, 128, "received %s", reason_str(t->reason.reason_id, SINGULAR)); return reason; }