summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-08-08 14:59:55 +0100
committerGary Lockyer <gary@samba.org>2019-08-28 01:47:40 +0000
commit61c5b891a14e47c784e0aae272630d78bf9c7831 (patch)
tree9b3ef2e5e9a46a0ab662ba46a46ebb64a9b3bc02 /source3/libsmb
parent2575e4066bf84d7a56f0b7126841f4ea5cc027fd (diff)
downloadsamba-61c5b891a14e47c784e0aae272630d78bf9c7831.tar.gz
s3/libsmb: clang: Fix value stored to 'offset' is never read
Fixes: source3/libsmb/nmblib.c:479:2: warning: Value stored to 'offset' is never read <--[clang] offset += 10+rec->rdlength; ^ ~~~~~~~~~~~~~~~~ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/nmblib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 727939575a7..b6dca800e94 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -462,13 +462,12 @@ static int put_compressed_name_ptr(unsigned char *buf,
struct res_rec *rec,
int ptr_offset)
{
- int ret=0;
+ int ret=offset;
if (buf) {
buf[offset] = (0xC0 | ((ptr_offset >> 8) & 0xFF));
buf[offset+1] = (ptr_offset & 0xFF);
}
offset += 2;
- ret += 2;
if (buf) {
RSSVAL(buf,offset,rec->rr_type);
RSSVAL(buf,offset+2,rec->rr_class);
@@ -477,7 +476,7 @@ static int put_compressed_name_ptr(unsigned char *buf,
memcpy(buf+offset+10,rec->rdata,rec->rdlength);
}
offset += 10+rec->rdlength;
- ret += 10+rec->rdlength;
+ ret = (offset - ret);
return ret;
}