diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-06-16 00:20:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-06-16 00:20:00 +0000 |
commit | 8c9edf12800bc6d68894dc457e7ebaf994429da8 (patch) | |
tree | ec6efefbd4e7f8227a7b96661f721ff4ba2986c3 /wiretap/k12text.l | |
parent | 3846abe34d6861c6ee0bba61fcd5baa4d213885c (diff) | |
download | wireshark-8c9edf12800bc6d68894dc457e7ebaf994429da8.tar.gz |
Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument.
This lets more of the libwiretap code be common between the read and
seek-read code paths, and also allows for more flexibility in the "fill
in the data" path - we can expand the buffer as needed in both cases.
svn path=/trunk/; revision=49949
Diffstat (limited to 'wiretap/k12text.l')
-rw-r--r-- | wiretap/k12text.l | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 97d9e6dd26..7e28f781b5 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -291,7 +291,7 @@ k12text_read(wtap *wth, int *err, char ** err_info, gint64 *data_offset) } static gboolean -k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, guint8 *pd, int length, int *err, char **err_info) +k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, Buffer *buf, int length, int *err, char **err_info) { if ( file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) { return FALSE; @@ -322,7 +322,8 @@ k12text_seek_read(wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr, guint8 * k12text_set_headers(phdr); - memcpy(pd, bb, length); + buffer_assure_space(buf, wth->phdr.caplen); + memcpy(buffer_start_ptr(buf), bb, length); return TRUE; } |