Re: [Qemu-devel] [PATCH 01/11] Add append method to qstring and empty constructor

2009-10-23 Thread Jamie Lokier
Luiz Capitulino wrote: > > qstring = qemu_malloc(sizeof(*qstring)); > > -qstring->string = qemu_strdup(str); > > + > > +qstring->length = strlen(str); > > +qstring->capacity = qstring->length; > > + > > +qstring->string = qemu_malloc(qstring->capacity + 1); > > +memcpy(qstr

Re: [Qemu-devel] [PATCH 01/11] Add append method to qstring and empty constructor

2009-10-18 Thread Luiz Capitulino
On Sat, 17 Oct 2009 08:36:01 -0500 Anthony Liguori wrote: > This allows qstring to be used for dynamic string construction. > > Signed-off-by: Anthony Liguori > --- > qstring.c | 37 - > qstring.h |4 > 2 files changed, 40 insertions(+), 1 deletio

[Qemu-devel] [PATCH 01/11] Add append method to qstring and empty constructor

2009-10-17 Thread Anthony Liguori
This allows qstring to be used for dynamic string construction. Signed-off-by: Anthony Liguori --- qstring.c | 37 - qstring.h |4 2 files changed, 40 insertions(+), 1 deletions(-) diff --git a/qstring.c b/qstring.c index 6d411da..441a9e6 100644 --