perf tools: Use scnprintf where applicable
authorArnaldo Carvalho de Melo <[email protected]>
Wed, 14 Mar 2012 15:29:29 +0000 (12:29 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 14 Mar 2012 15:36:19 +0000 (12:36 -0300)
commite7f01d1e3d8d501deb8abeaa269d5d48a703b8b0
tree2746465309fd16392ed7c6265dea53366c6e52c7
parentb832796caa1fda8516464a003c8c7cc547bc20c2
perf tools: Use scnprintf where applicable

Several places were expecting that the value returned was the number of
characters printed, not what would be printed if there was space.

Fix it by using the scnprintf and vscnprintf variants we inherited from
the kernel sources.

Some corner cases where the number of printed characters were not
accounted were fixed too.

Reported-by: Anton Blanchard <[email protected]>
Cc: Anton Blanchard <[email protected]>
Cc: Eric B Munson <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Yanmin Zhang <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/arch/powerpc/util/header.c
tools/perf/arch/x86/util/header.c
tools/perf/util/color.c
tools/perf/util/header.c
tools/perf/util/hist.c
tools/perf/util/strbuf.c
tools/perf/util/ui/browsers/hists.c
tools/perf/util/ui/helpline.c