summaryrefslogtreecommitdiff
path: root/xml/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'xml/type.c')
-rw-r--r--xml/type.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xml/type.c b/xml/type.c
index d311b30..0cb5c9a 100644
--- a/xml/type.c
+++ b/xml/type.c
@@ -7,11 +7,12 @@
#include <stdio.h>
const std::string &cxType::String(void) {
- static char buffer[50];
if (mType == number) {
- snprintf(buffer, sizeof(buffer), "%d", mNumber);
+ char *buffer;
+ asprintf(&buffer, "%d", mNumber);
mString = buffer;
mType = string;
+ free(buffer);
} else if (mType == boolean) {
mString = mNumber ? cxFunction::True : cxFunction::False;
mType = string;