aboutsummaryrefslogtreecommitdiffstats
path: root/qemu-option.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-09 17:08:24 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-06-01 17:08:17 +0200
commit488bfd506a283c648f559140f51f125847d68664 (patch)
treee5ba3fff5e45a232df4002121c00cfef26908e39 /qemu-option.c
parent1646b4eb23bb788e9398583c442db9b70a85921a (diff)
downloadexternal_qemu-488bfd506a283c648f559140f51f125847d68664.zip
external_qemu-488bfd506a283c648f559140f51f125847d68664.tar.gz
external_qemu-488bfd506a283c648f559140f51f125847d68664.tar.bz2
qemu-error: minor integrate
Change-Id: Ic6bc807b98e4dba0f2fcba046cd9a91a5d96f2cb
Diffstat (limited to 'qemu-option.c')
-rw-r--r--qemu-option.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/qemu-option.c b/qemu-option.c
index 1f8f41a..65db542 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -394,8 +394,8 @@ QEMUOptionParameter *append_option_parameters(QEMUOptionParameter *dest,
/*
* Parses a parameter string (param) into an option list (dest).
*
- * list is the templace is. If dest is NULL, a new copy of list is created for
- * it. If list is NULL, this function fails.
+ * list is the template option list. If dest is NULL, a new copy of list is
+ * created. If list is NULL, this function fails.
*
* A parameter string consists of one or more parameters, separated by commas.
* Each parameter consists of its name and possibly of a value. In the latter
@@ -416,20 +416,13 @@ QEMUOptionParameter *parse_option_parameters(const char *param,
char value[256];
char *param_delim, *value_delim;
char next_delim;
- size_t num_options;
if (list == NULL) {
return NULL;
}
if (dest == NULL) {
- // Count valid options
- num_options = count_option_parameters(list);
-
- // Create a copy of the option list to fill in values
- dest = qemu_mallocz((num_options + 1) * sizeof(QEMUOptionParameter));
- allocated = dest;
- memcpy(dest, list, (num_options + 1) * sizeof(QEMUOptionParameter));
+ dest = allocated = append_option_parameters(NULL, list);
}
while (*param) {