summaryrefslogtreecommitdiff
path: root/sf-pcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sf-pcap.c')
-rw-r--r--sf-pcap.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sf-pcap.c b/sf-pcap.c
index 659480b44d82..fd6c6a45f5bd 100644
--- a/sf-pcap.c
+++ b/sf-pcap.c
@@ -108,7 +108,7 @@
* read on systems with the same tv_sec size as the system on which
* the file was written.
*
- * THe fields are unsigned, as that's what the pcap draft specification
+ * The fields are unsigned, as that's what the pcap draft specification
* says they are. (That gives pcap a 68-year Y2.038K reprieve, although
* in 2106 it runs out for good. pcapng doesn't have that problem,
* unless you pick a *really* high time stamp precision.)
@@ -1224,7 +1224,7 @@ pcap_dump_ftell64(pcap_dumper_t *p)
}
#elif defined(_MSC_VER)
/*
- * We have Visual Studio; we support only 2005 and later, so we have
+ * We have Visual Studio; we support only 2015 and later, so we have
* _ftelli64().
*/
int64_t
@@ -1262,11 +1262,16 @@ pcap_dump_flush(pcap_dumper_t *p)
void
pcap_dump_close(pcap_dumper_t *p)
{
+ FILE *fp = (FILE *)p;
#ifdef notyet
- if (ferror((FILE *)p))
+ if (ferror(fp))
return-an-error;
- /* XXX should check return from fclose() too */
+ /* XXX should check return from fflush()/fclose() too */
#endif
- (void)fclose((FILE *)p);
+ /* Don't close the standard output, but *do* flush it */
+ if (fp == stdout)
+ (void)fflush(fp);
+ else
+ (void)fclose(fp);
}