nbt: Eliminate clang analyzer warning

By using strlcat later, we don't need to update pname_ret again,
since we only need the total size of the buffer. Elminates a
clang analyzer warning about writing a value that is never used
related to commit 9891a79137
This commit is contained in:
John Thacker 2022-10-16 17:36:21 -04:00
parent 1c9c1b5100
commit d248702b86
1 changed files with 1 additions and 2 deletions

View File

@ -400,8 +400,7 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset,
/* This one is; make its name printable. */
name_type = process_netbios_name(nbname, name_ret, name_ret_len);
pname_ret += MIN(strlen(name_ret), (size_t) name_ret_len);
pname_ret += MIN(name_ret_len-(pname_ret-name_ret),
snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "<%02x>", name_type));
snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "<%02x>", name_type);
if (cname == '.') {
/* We have a scope ID, starting at "pname"; append that to
* the decoded host name. */