diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-10-26 17:46:53 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-11-12 20:49:08 +0100 |
commit | c65d4e35dcdebc21d80c440944c11e1067743a8f (patch) | |
tree | e57740aaff7136d804e17e9737fa7dc4a393409e /perf | |
parent | 6dfb12c7d7c4ada716c86dbb9af3446d9880ed36 (diff) |
Use xstrdup instead of xmalloc when possible
Don't open code xstrdup, just use it.
Diffstat (limited to 'perf')
-rw-r--r-- | perf/cairo-perf-report.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c index 8df78c64..38bdc0cd 100644 --- a/perf/cairo-perf-report.c +++ b/perf/cairo-perf-report.c @@ -388,11 +388,9 @@ cairo_perf_report_load (cairo_perf_report_t *report, if (name == NULL) name = "stdin"; - configuration = xmalloc (strlen (name) * sizeof (char) + 1); - strcpy (configuration, name); + configuration = xstrdup (name); baseName = basename (configuration); - report->configuration = xmalloc (strlen (baseName) * sizeof (char) + 1); - strcpy (report->configuration, baseName); + report->configuration = xstrdup (baseName); free (configuration); dot = strrchr (report->configuration, '.'); |