Skip to content

Commit 781f0bb

Browse files
Zhu Junanakryiko
authored andcommitted
tools/bpf: Fix the wrong format specifier
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]
1 parent ba71ffb commit 781f0bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/bpf/bpftool/xlated_dumper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len,
349349

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

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

355355
if (opcodes) {
@@ -415,7 +415,7 @@ void dump_xlated_for_graph(struct dump_data *dd, void *buf_start, void *buf_end,
415415
}
416416
}
417417

418-
printf("%d: ", insn_off);
418+
printf("%u: ", insn_off);
419419
print_bpf_insn(&cbs, cur, true);
420420

421421
if (opcodes) {

0 commit comments

Comments
 (0)