]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Note that ndo_error doesn't, and *ndo_error shouldn't, return.
authorGuy Harris <[email protected]>
Sat, 25 Jun 2011 01:24:11 +0000 (18:24 -0700)
committerGuy Harris <[email protected]>
Sat, 25 Jun 2011 01:24:11 +0000 (18:24 -0700)
Tcpdump's ndo_error() doesn't return.  Any other ndo_error routine
supplied to netdissect shouldn't, either, as printers expect it not to.

netdissect.h
tcpdump.c

index 6770cd11e42ad7474939944fd1cc5e025eb9328e..6834f95df181a8654642e42fa06ffe18049435aa 100644 (file)
@@ -159,7 +159,7 @@ struct netdissect_options {
   void (*ndo_error)(netdissect_options *,
                    const char *fmt, ...)
 #ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
-                    __attribute__ ((format (printf, 2, 3)))
+                    __attribute__ ((noreturn, format (printf, 2, 3)))
 #endif
                     ;
   void (*ndo_warning)(netdissect_options *,
index a9afa8fe16b1aec728c0ad94fa2d000a990dbacd..fe9227075c10a867e09ca0332cf20b8dc01304e3 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -115,7 +115,8 @@ static void ndo_default_print(netdissect_options *, const u_char *, u_int);
 static void dump_packet_and_trunc(u_char *, const struct pcap_pkthdr *, const u_char *);
 static void dump_packet(u_char *, const struct pcap_pkthdr *, const u_char *);
 static void droproot(const char *, const char *);
-static void ndo_error(netdissect_options *ndo, const char *fmt, ...);
+static void ndo_error(netdissect_options *ndo, const char *fmt, ...)
+     __attribute__ ((noreturn, format (printf, 2, 3)));
 static void ndo_warning(netdissect_options *ndo, const char *fmt, ...);
 
 #ifdef SIGINFO