summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-05-29 03:36:44 +0200
committerGravatar Nikias Bassen2011-05-29 03:36:44 +0200
commit7f376a838be410af848b8b6689180baf79140ded (patch)
tree059215e89c532141887c3945e287f1e53021971c
parentf058a5aeddb57b4f453952bc4c03d26501f764ee (diff)
downloadlibplist-7f376a838be410af848b8b6689180baf79140ded.tar.gz
libplist-7f376a838be410af848b8b6689180baf79140ded.tar.bz2
Use malloc+snprintf instead of asprintf
-rw-r--r--src/xplist.c6
1 files changed, 4 insertions, 2 deletions
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: