diff options
author | Stefan Weil <sw@weilnetz.de> | 2013-01-16 18:37:23 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-01-19 10:24:43 +0000 |
commit | e4ada482420175bc17d6ccb9f2af0e769da78e01 (patch) | |
tree | 957c6756ff906ba4a5927479e714228512df7e1b /util/path.c | |
parent | 0e7a75929353b04bd2fce1be8640226883b42a10 (diff) |
Replace non-portable asprintf by g_strdup_printf
g_strdup_printf already handles OOM errors, so some error handling in
QEMU code can be removed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'util/path.c')
-rw-r--r-- | util/path.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/util/path.c b/util/path.c index 4c5b0f6296..f0c69627c7 100644 --- a/util/path.c +++ b/util/path.c @@ -47,10 +47,7 @@ static struct pathelem *new_entry(const char *root, { struct pathelem *new = malloc(sizeof(*new)); new->name = strdup(name); - if (asprintf(&new->pathname, "%s/%s", root, name) == -1) { - printf("Cannot allocate memory\n"); - exit(1); - } + new->pathname = g_strdup_printf("%s/%s", root, name); new->num_entries = 0; return new; } |