Remove the include of <sys/time.h> from "file.h" - it's neither
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 22 Aug 1999 07:19:28 +0000 (07:19 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 22 Aug 1999 07:19:28 +0000 (07:19 +0000)
necessary nor sufficient if you're using "struct tm" (on many, perhaps
most, perhaps even all modern UNIXes, <sys/time.h> includes <time.h>,
which declares "struct tm", but that's not necessarily the case on
non-UNIX systems).

Include <time.h> in "file.c", to declare "struct tm".

Don't use PCAP_ERRBUF_SIZE to declare a message string buffer - that
won't work if you don't have "libpcap".

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

file.c
file.h

diff --git a/file.c b/file.c
index 575684a22f41d6af1049db0685071f2e73693e41..b84389b4e5be809f9c4ee3a249bcc7c5f11a911e 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
 /* file.c
  * File I/O routines
  *
- * $Id: file.c,v 1.79 1999/08/22 02:52:42 guy Exp $
+ * $Id: file.c,v 1.80 1999/08/22 07:19:27 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -35,6 +35,8 @@
 #include <unistd.h>
 #endif
 
+#include <time.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
@@ -198,7 +200,7 @@ read_cap_file(capture_file *cf) {
   size_t  msg_len;
   char   *errmsg;
   char    errmsg_errno[1024+1];
-  gchar   err_str[PCAP_ERRBUF_SIZE];
+  gchar   err_str[2048+1];
 
   if ((name_ptr = (gchar *) strrchr(cf->filename, '/')) == NULL)
     name_ptr = cf->filename;
@@ -267,7 +269,7 @@ read_cap_file(capture_file *cf) {
       errmsg = errmsg_errno;
       break;
     }
-    snprintf(err_str, PCAP_ERRBUF_SIZE, errmsg);
+    snprintf(err_str, sizeof err_str, errmsg);
     simple_dialog(ESD_TYPE_WARN, NULL, err_str);
     return (err);
   } else
diff --git a/file.h b/file.h
index c83f7fbe68c0272ab70c942f53fbac851c12602c..e1b848af5fe31d2f617548d94bedf5f278b6d9fd 100644 (file)
--- a/file.h
+++ b/file.h
@@ -1,7 +1,7 @@
 /* file.h
  * Definitions for file structures and routines
  *
- * $Id: file.h,v 1.39 1999/08/22 00:47:43 guy Exp $
+ * $Id: file.h,v 1.40 1999/08/22 07:19:28 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #include <sys/types.h>
 #endif
 
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
 #ifndef __WTAP_H__
 #include "wiretap/wtap.h"
 #endif
@@ -44,7 +40,6 @@
 #endif
 #endif
 
-
 #ifndef __DFILTER_H__
 #include "dfilter.h"
 #endif