geonw: fix the column formatting.

1) G_GUINT16_FORMAT produces warnings about mismatched format string
formats and arguments if you use it with a 32-bit value.

2) There's no reason to format into a string buffer and then use
col_append_lstr(); col_append_fstr() suffices.  (In col_append_ports(),
the formatting is done with col_snprint_port(), which attempts to
resolve the port number to a name, but we don't do that here, we just
format it as a number.)
This commit is contained in:
Guy Harris 2021-02-28 22:21:33 -08:00
parent 73d793788c
commit e31bddb16f
1 changed files with 1 additions and 3 deletions

View File

@ -404,9 +404,7 @@ dissect_btpb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
pinfo->destport = dst_port;
char buf_dst[32];
snprintf(buf_dst, 32, "%"G_GUINT16_FORMAT, dst_port);
col_append_lstr(pinfo->cinfo, COL_INFO, " " UTF8_RIGHTWARDS_ARROW " ", buf_dst, COL_ADD_LSTR_TERMINATOR);
col_append_fstr(pinfo->cinfo, COL_INFO, " " UTF8_RIGHTWARDS_ARROW " %u", dst_port);
btpbh->btp_pdst = dst_port;
btpbh->btp_idst = dst_info;