aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-09-23 05:55:56 +0000
committerGuy Harris <guy@alum.mit.edu>1999-09-23 05:55:56 +0000
commit560e64cb7308d8a509bbfa05140e8213cdce9fb5 (patch)
tree537cd64c207f229bb1b81aad7477afb9109868a4 /file.c
parent522b27e2909868a9433f590ae64a2b2fed223f42 (diff)
downloadwireshark-560e64cb7308d8a509bbfa05140e8213cdce9fb5.tar.gz
wireshark-560e64cb7308d8a509bbfa05140e8213cdce9fb5.tar.bz2
wireshark-560e64cb7308d8a509bbfa05140e8213cdce9fb5.zip
Make the buffer into which we read from the sync pipe one byte bigger
than the size of the reads we do, so that we have an extra byte at the end into which we can stick a '\0' to guarantee null-termination of the buffer. When reading the capture file in "tail_cap_file()", use "file_open()" rather than "fopen()", so that we work correctly if we're using "zlib" to read capture files. svn path=/trunk/; revision=707
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/file.c b/file.c
index 518cd32694..3e63ee0ac6 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.96 1999/09/23 04:38:52 ashokn Exp $
+ * $Id: file.c,v 1.97 1999/09/23 05:55:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -295,7 +295,7 @@ void
cap_file_input_cb (gpointer data, gint source, GdkInputCondition condition) {
capture_file *cf = (capture_file *)data;
- char buffer[256], *p = buffer, *q = buffer;
+ char buffer[256+1], *p = buffer, *q = buffer;
int nread;
int to_read = 0;
gboolean exit_loop = FALSE;
@@ -391,7 +391,7 @@ tail_cap_file(char *fname, capture_file *cf) {
}
}
- cf->fh = fopen(fname, "r");
+ cf->fh = file_open(fname, "r");
cap_input_id = gtk_input_add_full (sync_pipe[0],
GDK_INPUT_READ,