From Jiri Engelthaler via
[metze/wireshark/wip.git] / capture_stop_conditions.c
index 6c1b9e83c7a89169a3f4070bdc794aa18e07f610..debf9f9247850f4113481ea90731cd161ca645c1 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $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
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include "config.h"
+
 #include <time.h>
 #include <string.h>
 #include <stdlib.h>
@@ -119,8 +121,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()*/