summaryrefslogtreecommitdiff
path: root/qstring.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-11-18 23:05:26 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:19 -0600
commit90b619930f88412975ee66099fb361271366c6b2 (patch)
treeab924b29fee8f3133a95291ec08b984ec3aa71de /qstring.c
parentf02219d1d0b7a50b7b1273d632c94384e6f014b1 (diff)
downloadqemu-90b619930f88412975ee66099fb361271366c6b2.tar.gz
qemu-90b619930f88412975ee66099fb361271366c6b2.tar.bz2
qemu-90b619930f88412975ee66099fb361271366c6b2.zip
QString: Introduce qstring_append_int()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qstring.c')
-rw-r--r--qstring.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/qstring.c b/qstring.c
index e422bd952d..ad1776949d 100644
--- a/qstring.c
+++ b/qstring.c
@@ -75,6 +75,14 @@ void qstring_append(QString *qstring, const char *str)
qstring->string[qstring->length] = 0;
}
+void qstring_append_int(QString *qstring, int64_t value)
+{
+ char num[32];
+
+ snprintf(num, sizeof(num), "%" PRId64, value);
+ qstring_append(qstring, num);
+}
+
/**
* qstring_append_chr(): Append a C char to a QString
*/