From e4ada482420175bc17d6ccb9f2af0e769da78e01 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 16 Jan 2013 18:37:23 +0100 Subject: 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 Signed-off-by: Blue Swirl --- util/path.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'util/path.c') diff --git a/util/path.c b/util/path.c index 4c5b0f6..f0c6962 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; } -- cgit v1.1