diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2012-12-18 18:18:11 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2012-12-18 18:18:11 +0000 |
commit | f55922be77eb3f543a9503170340f8aeafdb41f9 (patch) | |
tree | 88f21ecb553eebb3f5b711174efcd2779078e671 /pcapio.c | |
parent | 7cf5334332fab7fbe47006a315998a3c5fc45929 (diff) | |
download | wireshark-f55922be77eb3f543a9503170340f8aeafdb41f9.tar.gz wireshark-f55922be77eb3f543a9503170340f8aeafdb41f9.tar.bz2 wireshark-f55922be77eb3f543a9503170340f8aeafdb41f9.zip |
Fix sequence of parameters. The size is the second parameter of fwrite,
the nitems the third, not vice versa.
svn path=/trunk/; revision=46592
Diffstat (limited to 'pcapio.c')
-rw-r--r-- | pcapio.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -180,7 +180,7 @@ struct option { do { \ size_t nwritten; \ \ - nwritten = fwrite(data_pointer, 1, data_length, file_pointer); \ + nwritten = fwrite(data_pointer, data_length, 1, file_pointer); \ if (nwritten != data_length) { \ if (nwritten == 0 && ferror(file_pointer)) { \ *error_pointer = errno; \ @@ -223,7 +223,7 @@ libpcap_write_file_header(FILE *fp, int linktype, int snaplen, gboolean ts_nsecs file_hdr.sigfigs = 0; /* unknown, but also apparently unused */ file_hdr.snaplen = snaplen; file_hdr.network = linktype; - nwritten = fwrite(&file_hdr, 1, sizeof(file_hdr), fp); + nwritten = fwrite(&file_hdr, sizeof(file_hdr), 1, fp); if (nwritten != sizeof(file_hdr)) { if (nwritten == 0 && ferror(fp)) *err = errno; @@ -249,7 +249,7 @@ libpcap_write_packet(FILE *fp, const struct pcap_pkthdr *phdr, const u_char *pd, rec_hdr.ts_usec = phdr->ts.tv_usec; rec_hdr.incl_len = phdr->caplen; rec_hdr.orig_len = phdr->len; - nwritten = fwrite(&rec_hdr, 1, sizeof rec_hdr, fp); + nwritten = fwrite(&rec_hdr, sizeof(rec_hdr), 1, fp); if (nwritten != sizeof rec_hdr) { if (nwritten == 0 && ferror(fp)) *err = errno; @@ -259,7 +259,7 @@ libpcap_write_packet(FILE *fp, const struct pcap_pkthdr *phdr, const u_char *pd, } *bytes_written += sizeof rec_hdr; - nwritten = fwrite(pd, 1, phdr->caplen, fp); + nwritten = fwrite(pd, phdr->caplen, 1, fp); if (nwritten != phdr->caplen) { if (nwritten == 0 && ferror(fp)) *err = errno; |