aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ngsniffer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-05-04 10:00:18 +0000
committerGuy Harris <guy@alum.mit.edu>2002-05-04 10:00:18 +0000
commit82f364ab1ab3bdfc58ebd9741b384f01ba606e68 (patch)
treedeaf27215a0e8f4e1f0be469515d5e28a18a8d00 /wiretap/ngsniffer.c
parent2be776e06c1df4d54dd5076760ee34b031cc8e8d (diff)
Fix capture-file-specific "close output" routines to check whether the
"err" argument is null and return an error code through that argument only if it isn't, to match what "wtap_dump_close()", which calls those routines, does. Put the NetXRay dump routines in order by version number. svn path=/trunk/; revision=5385
Diffstat (limited to 'wiretap/ngsniffer.c')
-rw-r--r--wiretap/ngsniffer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 8758fb8d9e..2caef77d0a 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -1,6 +1,6 @@
/* ngsniffer.c
*
- * $Id: ngsniffer.c,v 1.79 2002/04/30 08:48:27 guy Exp $
+ * $Id: ngsniffer.c,v 1.80 2002/05/04 10:00:18 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -1559,10 +1559,12 @@ static gboolean ngsniffer_dump_close(wtap_dumper *wdh, int *err)
nwritten = fwrite(buf, 1, 6, wdh->fh);
if (nwritten != 6) {
- if (nwritten == 0 && ferror(wdh->fh))
- *err = errno;
- else
- *err = WTAP_ERR_SHORT_WRITE;
+ if (err != NULL) {
+ if (nwritten == 0 && ferror(wdh->fh))
+ *err = errno;
+ else
+ *err = WTAP_ERR_SHORT_WRITE;
+ }
return FALSE;
}
return TRUE;