X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=blobdiff_plain;f=capture_stop_conditions.c;h=09ac5b7d4ab94810feb1bd0bd64bb1b0682b74cb;hp=1b1adff53c84021b826d28ed77c01dbba38aa180;hb=35728497bcd3696d683b104f0d3cb8126229affa;hpb=68cedde6164517c47001280af867fd57756650ff diff --git a/capture_stop_conditions.c b/capture_stop_conditions.c index 1b1adff53c..09ac5b7d4a 100644 --- a/capture_stop_conditions.c +++ b/capture_stop_conditions.c @@ -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 + * Wireshark - Network traffic analyzer + * By Gerald Combs * 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() */ /*