summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hromatka <tom.hromatka@oracle.com>2020-12-02 13:27:27 -0700
committerPaul Moore <paul@paul-moore.com>2021-08-12 12:35:27 -0400
commitd8996169a6d09b1a8bd46b7728250c8a7080ba45 (patch)
tree4420d86ee1696f7be7ff035e5b7a61ec2ac86cce
parent35aadbe7cec2322d43c03da6468cc34d83993031 (diff)
downloadlibseccomp-d8996169a6d09b1a8bd46b7728250c8a7080ba45.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> (imported from commit 947ecc884d5c503c08fd10d580cb6b353fa0f31a)
-rw-r--r--tools/scmp_bpf_disasm.c6
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);