Don't reset the packet count if we longjmp out of the capture loop, as
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 31 Oct 2002 20:24:41 +0000 (20:24 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 31 Oct 2002 20:24:41 +0000 (20:24 +0000)
that causes us to report that no packets were captured if you ^C out of
a capture.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6523 f5534014-38df-0310-8fa8-9805f1628bb7

tethereal.c

index 97f9a61be9ae0aed3faf9b0d53377de2813b7226..4d5bbe0b97069b9810c790b33023ffae77264428 100644 (file)
@@ -1,6 +1,6 @@
 /* tethereal.c
  *
- * $Id: tethereal.c,v 1.165 2002/10/25 03:13:07 guy Exp $
+ * $Id: tethereal.c,v 1.166 2002/10/31 20:24:41 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1144,11 +1144,11 @@ capture(int out_file_type)
     cnd_stop_timeout = cnd_new((char*)CND_CLASS_TIMEOUT,
                                (gint32)capture_opts.autostop_duration);
 
-  if (!setjmp(ld.stopenv))
+  if (!setjmp(ld.stopenv)) {
     ld.go = TRUE;
-  else
+    ld.packet_count = 0;
+  } else
     ld.go = FALSE;
-  ld.packet_count = 0;
   while (ld.go) {
     /* We need to be careful with automatic variables defined in the
        outer scope which are changed inside the loop.  Most compilers