diff options
author | Tom Hromatka <tom.hromatka@oracle.com> | 2020-12-02 13:27:27 -0700 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2021-07-26 22:29:27 -0400 |
commit | 947ecc884d5c503c08fd10d580cb6b353fa0f31a (patch) | |
tree | 815e81d65483276319a3f477f909c309448f9646 /tools | |
parent | dc775c014880cebb0087fb130d0163ff6f56e912 (diff) | |
download | libseccomp-947ecc884d5c503c08fd10d580cb6b353fa0f31a.tar.gz |
tools: fix scan-build warnings in scmp_bpf_disasm
Delete the unused variable 'len' from scmp_bpf_disasm.
scan-build identified the following two warnings:
scmp_bpf_disasm.c:304:10: warning: Although the value stored to 'len'
is used in the enclosing expression, the value is never actually read
from 'len'
while ((len = fread(&bpf, sizeof(bpf), 1, file))) {
scmp_bpf_disasm.c:441:10: warning: Although the value stored to 'len' is
used in the enclosing expression, the value is never actually read from
'len'
while ((len = fread(&bpf, sizeof(bpf), 1, file))) {
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/scmp_bpf_disasm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/scmp_bpf_disasm.c b/tools/scmp_bpf_disasm.c index b95cdeb..b682de7 100644 --- a/tools/scmp_bpf_disasm.c +++ b/tools/scmp_bpf_disasm.c @@ -294,14 +294,13 @@ static void bpf_decode_args(const bpf_instr_raw *bpf, unsigned int line) static int bpf_decode(FILE *file) { unsigned int line = 0; - size_t len; bpf_instr_raw bpf; /* header */ printf(" line OP JT JF K\n"); printf("=================================\n"); - while ((len = fread(&bpf, sizeof(bpf), 1, file))) { + while (fread(&bpf, sizeof(bpf), 1, file)) { /* convert the bpf statement */ bpf.code = ttoh16(arch, bpf.code); bpf.k = ttoh32(arch, bpf.k); @@ -430,7 +429,6 @@ static void bpf_dot_decode_args(const bpf_instr_raw *bpf, unsigned int line) static int bpf_dot_decode(FILE *file) { unsigned int line = 0; - size_t len; bpf_instr_raw bpf; int prev_class = 0; @@ -438,7 +436,7 @@ static int bpf_dot_decode(FILE *file) printf("digraph {\n"); printf("\tstart[shape=\"box\", style=rounded];\n"); - while ((len = fread(&bpf, sizeof(bpf), 1, file))) { + while (fread(&bpf, sizeof(bpf), 1, file)) { /* convert the bpf statement */ bpf.code = ttoh16(arch, bpf.code); bpf.k = ttoh32(arch, bpf.k); |