tools/xenpmd: Fix gcc10 snprintf warning
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 15 Oct 2020 09:16:09 +0000 (10:16 +0100)
committerWei Liu <wl@xen.org>
Fri, 16 Oct 2020 13:28:55 +0000 (13:28 +0000)
commit0dfddb2116e3757f77a691a3fe335173088d69dc
treec21541963a9cf2f17a763a262cc55eb76e49b403
parent17d192e0238d6c714e9f04593b59597b7090be38
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>
tools/xenpmd/xenpmd.c