Skip to content

Commit

Permalink
tools/bpf: Fix the wrong format specifier
Browse files Browse the repository at this point in the history
The format specifier of "unsigned int" in printf() should be "%u", not
"%d".

Signed-off-by: Zhu Jun <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
Zhu Jun authored and qmonnet committed Sep 2, 2024
1 parent 00e7019 commit cb035aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xlated_dumper.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len,

double_insn = insn[i].code == (BPF_LD | BPF_IMM | BPF_DW);

printf("% 4d: ", i);
printf("%4u: ", i);
print_bpf_insn(&cbs, insn + i, true);

if (opcodes) {
Expand Down Expand Up @@ -415,7 +415,7 @@ void dump_xlated_for_graph(struct dump_data *dd, void *buf_start, void *buf_end,
}
}

printf("%d: ", insn_off);
printf("%u: ", insn_off);
print_bpf_insn(&cbs, cur, true);

if (opcodes) {
Expand Down

0 comments on commit cb035aa

Please sign in to comment.