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>
This commit is contained in:
Guy Harris 2015-02-26 20:35:31 -08:00
parent 9ac60ff0df
commit 64c06785ea
1 changed files with 5 additions and 4 deletions

View File

@ -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';