Skip to content

Commit

Permalink
tools: bpftool: fix format string for p_err() in detect_common_prefix()
Browse files Browse the repository at this point in the history
There is one call to the p_err() function in detect_common_prefix()
where the message to print is passed directly as the first argument,
without using a format string. This is harmless, but may trigger
warnings if the "__printf()" attribute is used correctly for the p_err()
function. Let's fix it by using a "%s" format string.

Fixes: ba95c74 ("tools: bpftool: add "prog run" subcommand to test-run programs")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Quentin Monnet authored and Alexei Starovoitov committed Aug 16, 2019
1 parent 8a15d5c commit b0ead6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int detect_common_prefix(const char *arg, ...)
strncat(msg, "'", sizeof(msg) - strlen(msg) - 1);

if (count >= 2) {
p_err(msg);
p_err("%s", msg);
return -1;
}

Expand Down

0 comments on commit b0ead6d

Please sign in to comment.