diff options
| author | Stefan Weil | 2013-01-16 18:37:23 +0100 |
|---|---|---|
| committer | Blue Swirl | 2013-01-19 11:24:43 +0100 |
| commit | e4ada482420175bc17d6ccb9f2af0e769da78e01 (patch) | |
| tree | 957c6756ff906ba4a5927479e714228512df7e1b /util | |
| parent | vl: Use size_t for sizes in get_boot_devices_list() (diff) | |
| download | qemu-e4ada482420175bc17d6ccb9f2af0e769da78e01.tar.gz qemu-e4ada482420175bc17d6ccb9f2af0e769da78e01.tar.xz qemu-e4ada482420175bc17d6ccb9f2af0e769da78e01.zip | |
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')
| -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; } |
