selftests/bpf: fix a test for snprintf() overflow
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 19 Jul 2022 09:50:32 +0000 (12:50 +0300)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 19 Jul 2022 17:45:45 +0000 (10:45 -0700)
commitc5d22f4cfe8dfb93f1db0a1e7e2e7ebc41395d98
treed71de2438770abdb4f9c9a9ea9eabaa265c2b7d4
parent979855d3026401ed6eecfd1935d19fd7b74df479
selftests/bpf: fix a test for snprintf() overflow

The snprintf() function returns the number of bytes which *would*
have been copied if there were space.  In other words, it can be
> sizeof(pin_path).

Fixes: c0fa1b6c3efc ("bpf: btf: Add BTF tests")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/YtZ+aD/tZMkgOUw+@kili
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/btf.c