perf tools: Convert open coded equivalents to asprintf()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 4 Jul 2014 11:43:48 +0000 (14:43 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 7 Jul 2014 19:55:24 +0000 (16:55 -0300)
commitd400a68d1f1e7a1fc7c5caf9024d4e67b218558d
treecba65b9040c912b23d467e9ddf79b23b35fa0c27
parentf8d9ccde2be4c24bfb8787af36a59a981b00a02d
perf tools: Convert open coded equivalents to asprintf()

The following snippet
V = malloc(S);
if (!V) { }
sprintf(V, ...)

Can be easily changed to a one line:

if (asprintf(&V, ...) < 0) { }

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Link: http://lkml.kernel.org/r/1404474229-15272-1-git-send-email-andriy.shevchenko@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/trace-event-info.c
tools/perf/util/util.c