From 7f376a838be410af848b8b6689180baf79140ded Mon Sep 17 00:00:00 2001
From: Nikias Bassen
Date: Sun, 29 May 2011 03:36:44 +0200
Subject: Use malloc+snprintf instead of asprintf

---
 src/xplist.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/xplist.c b/src/xplist.c
index 899cc81..f62178e 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -161,12 +161,14 @@ static void node_to_xml(node_t* node, void *xml_struct)
 
     case PLIST_UINT:
         tag = XPLIST_INT;
-        (void)asprintf(&val, "%"PRIu64, node_data->intval);
+        val = (char*)malloc(64);
+        (void)snprintf(val, 64, "%"PRIu64, node_data->intval);
         break;
 
     case PLIST_REAL:
         tag = XPLIST_REAL;
-        (void)asprintf(&val, "%f", node_data->realval);
+        val = (char*)malloc(64);
+        (void)snprintf(val, 64, "%f", node_data->realval);
         break;
 
     case PLIST_STRING:
-- 
cgit v1.1-32-gdbae