TCP: fix no previous prototype for 'exp_pdu_tcp_dissector_data_size/exp_pdu_tcp_disse...
[metze/wireshark/wip.git] / capture_stop_conditions.c
index debf9f9247850f4113481ea90731cd161ca645c1..4a2ccaed2a48385f0175ee4d57efcc64d150109f 100644 (file)
@@ -1,8 +1,6 @@
 /* capture_stop_conditions.c
  * Implementation for 'stop condition handler'.
  *
- * $Id$
- *
  * Wireshark - Network traffic analyzer
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "config.h"
+#include <config.h>
 
 #include <time.h>
 #include <string.h>
 #include <stdlib.h>
-#include <sys/stat.h>
 #include <stdarg.h>
 #include "conditions.h"
 #include "capture_stop_conditions.h"
@@ -145,7 +142,7 @@ const char* CND_CLASS_CAPTURESIZE = "cnd_class_capturesize";
 
 /* structure that contains user supplied data for this condition */
 typedef struct _cnd_capturesize_dat{
-  long max_capture_size;
+  guint64 max_capture_size;
 }cnd_capturesize_dat;
 
 /*
@@ -164,7 +161,9 @@ static condition* _cnd_constr_capturesize(condition* cnd, va_list ap){
   if((data = (cnd_capturesize_dat*)g_malloc(sizeof(cnd_capturesize_dat))) == NULL)
     return NULL;
   /* initialize user data */
-  data->max_capture_size = va_arg(ap, long);
+  data->max_capture_size = va_arg(ap, guint64);
+  if (data->max_capture_size > ((guint64)INT_MAX + 1))
+    data->max_capture_size = (guint64)INT_MAX + 1;
   cnd_set_user_data(cnd, (void*)data);
   return cnd;
 } /* END _cnd_constr_capturesize() */
@@ -194,7 +193,7 @@ static gboolean _cnd_eval_capturesize(condition* cnd, va_list ap){
   cnd_capturesize_dat* data = (cnd_capturesize_dat*)cnd_get_user_data(cnd);
   /* check capturesize here */
   if(data->max_capture_size == 0) return FALSE; /* 0 == infinite */
-  if(va_arg(ap, long) >= data->max_capture_size){
+  if(va_arg(ap, guint64) >= data->max_capture_size){
     return TRUE;
   }
   return FALSE;
@@ -208,3 +207,16 @@ static gboolean _cnd_eval_capturesize(condition* cnd, va_list ap){
  */
 static void _cnd_reset_capturesize(condition *cnd _U_){
 } /* END _cnd_reset_capturesize() */
+
+/*
+ * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
+ *
+ * Local Variables:
+ * c-basic-offset: 2
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=2 tabstop=8 expandtab:
+ * :indentSize=2:tabSize=8:noTabs=true:
+ */