]> xenbits.xensource.com Git - xen.git/commit
tools/xenpmd: Fix gcc10 snprintf warning
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 15 Oct 2020 09:16:09 +0000 (10:16 +0100)
committerIan Jackson <iwj@xenproject.org>
Mon, 9 Nov 2020 17:14:23 +0000 (17:14 +0000)
commit1f9f1cb3a0216a7d41ded3090b4bb2735cc8a8e6
tree7f9a9745909cae66e720a9720d22b7bfc17e8a29
parentf728b2d69f426258f37709de9efac5245a597d0d
tools/xenpmd: Fix gcc10 snprintf warning

Add a check for snprintf return code and ignore the entry if we get an
error. This should in fact never happen and is more a trick to make gcc
happy and prevent compilation errors.

This is solving the following gcc warning when compiling for arm32 host
platforms with optimization activated:
xenpmd.c:92:37: error: '%s' directive output may be truncated writing
between 4 and 2147483645 bytes into a region of size 271
[-Werror=format-truncation=]

This is also solving the following Debian bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970802

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Wei Liu <wl@xen.org>
(cherry picked from commit 0dfddb2116e3757f77a691a3fe335173088d69dc)
tools/xenpmd/xenpmd.c