tools: xenalyze.c fix format-truncation
authorJohn Thomson <git@johnthomson.fastmail.com.au>
Wed, 14 Mar 2018 08:21:24 +0000 (18:21 +1000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 14 Mar 2018 10:01:26 +0000 (10:01 +0000)
commit87554421b9ffcebe0a89ba9a927bccc0c7bed7f3
tree7c7f456d3e36db678ed04b76e3128e30cbdb8dc6
parenta7313da7f7767984172873adf645eff9bd667bda
tools: xenalyze.c fix format-truncation

With gcc optimization enabled by:
tools: detect appropriate debug optimization level
b43501451733193b265de30fd79a764363a2a473

-Wformat-truncation throws warnings

gcc version 7.3.0

xenalyze.c: In function 'find_symbol':
xenalyze.c:382:36: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
     snprintf(name, 128, "(%s +%llx)",
                                    ^
xenalyze.c:382:5: note: 'snprintf' output between 6 and 144 bytes into a destination of size 128
     snprintf(name, 128, "(%s +%llx)",
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              lastname, offset);
              ~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
tools/xentrace/xenalyze.c