diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-02-26 20:35:31 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-02-27 04:35:57 +0000 |
commit | 64c06785ea90fb37c97fc323f62bee0892107d50 (patch) | |
tree | 93931ea262db8e97ed2920b4dc9cc56849d0e33c /epan | |
parent | 9ac60ff0df25765612d219dcaa7fe1210f6e0bcd (diff) | |
download | wireshark-64c06785ea90fb37c97fc323f62bee0892107d50.tar.gz |
Again, we need a separate pointer to advance through the buffer.
In this case, sometimes we step through the buffer and sometimes we
don't, so we always use strlen(); use a separate pointer when we're
stepping through the buffer.
Change-Id: Id69898760b4c255146c6eae0ab44c1d358c9ccbd
Reviewed-on: https://code.wireshark.org/review/7425
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-sna.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c index bfda7bef4e..d66ca3f552 100644 --- a/epan/dissectors/packet-sna.c +++ b/epan/dissectors/packet-sna.c @@ -833,6 +833,7 @@ static int sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len _U_) { const guint8 *addrdata; struct sna_fid_type_4_addr sna_fid_type_4_addr; + gchar *bufp = buf; switch (addr->len) { @@ -852,10 +853,10 @@ static int sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len _U_) /* FID Type 4 */ memcpy(&sna_fid_type_4_addr, addr->data, SNA_FID_TYPE_4_ADDR_LEN); - buf = dword_to_hex(buf, sna_fid_type_4_addr.saf); - *buf++ = '.'; - buf = word_to_hex(buf, sna_fid_type_4_addr.ef); - *buf++ = '\0'; /* NULL terminate */ + bufp = dword_to_hex(bufp, sna_fid_type_4_addr.saf); + *bufp++ = '.'; + bufp = word_to_hex(bufp, sna_fid_type_4_addr.ef); + *bufp++ = '\0'; /* NULL terminate */ break; default: buf[0] = '\0'; |