Make the counters in the summary 64-bit, so they don't overflow on
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 8 Jul 2005 09:12:11 +0000 (09:12 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 8 Jul 2005 09:12:11 +0000 (09:12 +0000)
Really Big Captures.

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

gtk/summary_dlg.c
summary.h

index 03a8309c677015cc58fe23c37facd9382339f635..2fd1317f6dd4a67be9bfed1601bc9c060be5f27b 100644 (file)
@@ -215,7 +215,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
 
   /* Dropped count */
   if (summary.drops_known) {
-    g_snprintf(string_buff, SUM_STR_MAX, "%u", summary.drops);
+    g_snprintf(string_buff, SUM_STR_MAX, "%" PRIu64, summary.drops);
   } else {
     g_snprintf(string_buff, SUM_STR_MAX, "unknown");
   }
@@ -319,9 +319,9 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
   add_string_to_list(list, "Avg. packet size", string_buff, string_buff2);
 
   /* Byte count */
-  g_snprintf(string_buff, SUM_STR_MAX, "%d", summary.bytes);
+  g_snprintf(string_buff, SUM_STR_MAX, "%" PRIu64, summary.bytes);
   if (summary.dfilter && summary.filtered_count > 0){
-    g_snprintf(string_buff2, SUM_STR_MAX, "%d", summary.filtered_bytes);
+    g_snprintf(string_buff2, SUM_STR_MAX, "%" PRIu64, summary.filtered_bytes);
   } else {
     strcpy(string_buff2, "");
   }
index d3e2af1d750d52874bb304ab810bd5923c8b507e..e417fef6937817c5481b2e7fd35f4088aa330936 100644 (file)
--- a/summary.h
+++ b/summary.h
@@ -31,7 +31,7 @@
 #endif
 
 typedef struct _summary_tally {
-    guint32    bytes;          /* total bytes */
+    guint64    bytes;          /* total bytes */
     double     start_time;     /* seconds, with msec resolution */
     double     stop_time;      /* seconds, with msec resolution */
     double     elapsed_time;   /* seconds, with msec resolution,
@@ -40,7 +40,7 @@ typedef struct _summary_tally {
     int                marked_count;   /* number of marked packets */
     int                packet_count;   /* total number of packets in trace */
     int                filtered_count; /* number of filtered packets */
-    guint32    filtered_bytes; /* total bytes in the filtered packets */
+    guint64    filtered_bytes; /* total bytes in the filtered packets */
     double     filtered_start; /* time in seconds, with msec resolution */
     double     filtered_stop;  /* time in seconds, with msec resolution */
     const char *filename;
@@ -49,7 +49,7 @@ typedef struct _summary_tally {
     gboolean   has_snap;       /* TRUE if maximum capture packet length is known */
     int                snap;           /* Maximum captured packet length */
     gboolean    drops_known;   /* TRUE if number of packet drops is known */
-    guint32     drops;         /* number of packet drops */
+    guint64     drops;         /* number of packet drops */
     const char *dfilter;       /* display filter */
 
     /* capture related, use summary_fill_in_capture() to get values */