aboutsummaryrefslogtreecommitdiff
path: root/fmtutils.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-06-25 01:55:16 -0700
committerGuy Harris <guy@alum.mit.edu>2019-06-25 01:55:16 -0700
commitf542342e5e232c9ed522b99897cf7aedccc89fe8 (patch)
treecd461f255af7cd07a7e9a0646c1ca9d5d9307f2f /fmtutils.c
parent7c0194357a364610afcbacfd48ed5d628f291e6c (diff)
Use "ab+" rather than "rb+" for the pcap_dump_open_append() open mode.
That way, the file will be created if it doesn't exist. Do a seek to the beginning of the file before checking whether it has a file header; ISO C says it's implementation-defined whether an open in append mode puts the file position indicator at the beginning or the end of the file, and neither the Single UNIX Specification nor the Microsoft documentation seemed to indicate which of those are the case. Consistently cast the result of fclose() on an open failure to void - we've already gotten an error, so we don't care whether the close fails as well. Clean up an error message slightly. See GitHub issue #247.
Diffstat (limited to 'fmtutils.c')
0 files changed, 0 insertions, 0 deletions