]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print.c
Note that interfaces may have numerical names.
[tcpdump] / print.c
diff --git a/print.c b/print.c
index 05e052272b50e394c91508c656c379dc8bbaa174..3a060d4158ccf248ad52f63e50aaaec444b59716 100644 (file)
--- a/print.c
+++ b/print.c
@@ -245,7 +245,7 @@ static int  ndo_printf(netdissect_options *ndo _U_, const char *fmt, ...)
                     ;
 
 void
-init_print(netdissect_options *ndo, u_int32_t localnet, u_int32_t mask,
+init_print(netdissect_options *ndo, uint32_t localnet, uint32_t mask,
     uint32_t timezone_offset)
 {
 
@@ -429,6 +429,7 @@ ndo_error(netdissect_options *ndo, const char *fmt, ...)
                if (fmt[-1] != '\n')
                        (void)fputc('\n', stderr);
        }
+       nd_cleanup();
        exit(1);
        /* NOTREACHED */
 }
@@ -462,6 +463,8 @@ ndo_printf(netdissect_options *ndo _U_, const char *fmt, ...)
        ret = vfprintf(stdout, fmt, args);
        va_end(args);
 
+       if (ret < 0)
+               ndo_error(ndo, "Unable to write output: %s", pcap_strerror(errno));
        return (ret);
 }