Fix a couple (value) mistakes in value_strings. Found by Martin's patch on the ...
[obnox/wireshark/wip.git] / capture_stop_conditions.c
index 1b1adff53c84021b826d28ed77c01dbba38aa180..09ac5b7d4ab94810feb1bd0bd64bb1b0682b74cb 100644 (file)
@@ -1,10 +1,10 @@
 /* capture_stop_conditions.c
  * Implementation for 'stop condition handler'.
  *
- * $Id: capture_stop_conditions.c,v 1.4 2002/08/28 21:00:05 jmayer Exp $
+ * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
  * This program is free software; you can redistribute it and/or
@@ -84,7 +84,7 @@ typedef struct _cnd_timeout_dat{
 static condition* _cnd_constr_timeout(condition* cnd, va_list ap){
   cnd_timeout_dat *data = NULL;
   /* allocate memory */
-  if((data = (cnd_timeout_dat*)malloc(sizeof(cnd_timeout_dat))) == NULL)
+  if((data = (cnd_timeout_dat*)g_malloc(sizeof(cnd_timeout_dat))) == NULL)
     return NULL;
   /* initialize user data */
   data->start_time = time(NULL);
@@ -101,7 +101,7 @@ static condition* _cnd_constr_timeout(condition* cnd, va_list ap){
  */
 static void _cnd_destr_timeout(condition* cnd){
   /* free memory */
-  free(cnd_get_user_data(cnd));
+  g_free(cnd_get_user_data(cnd));
 } /* END _cnd_destr_timeout() */
 
 /*
@@ -119,8 +119,8 @@ static gboolean _cnd_eval_timeout(condition* cnd, va_list ap _U_){
   gint32 elapsed_time;
   /* check timeout here */
   if(data->timeout_s == 0) return FALSE; /* 0 == infinite */
-  elapsed_time = time(NULL) - data->start_time;
-  if(elapsed_time > data->timeout_s) return TRUE;
+  elapsed_time = (gint32) (time(NULL) - data->start_time);
+  if(elapsed_time >= data->timeout_s) return TRUE;
   return FALSE;
 } /* END _cnd_eval_timeout()*/
 
@@ -159,7 +159,7 @@ typedef struct _cnd_capturesize_dat{
 static condition* _cnd_constr_capturesize(condition* cnd, va_list ap){
   cnd_capturesize_dat *data = NULL;
   /* allocate memory */
-  if((data = (cnd_capturesize_dat*)malloc(sizeof(cnd_capturesize_dat))) == NULL)
+  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);
@@ -175,7 +175,7 @@ static condition* _cnd_constr_capturesize(condition* cnd, va_list ap){
  */
 static void _cnd_destr_capturesize(condition* cnd){
   /* free memory */
-  free(cnd_get_user_data(cnd));
+  g_free(cnd_get_user_data(cnd));
 } /* END _cnd_destr_capturesize() */
 
 /*