From 1274bc0971966a53a139fcc18d9c16d735d4f5fc Mon Sep 17 00:00:00 2001 From: megazig Date: Wed, 20 May 2009 23:12:55 -0500 Subject: cleaned up memory leaks --- xml.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xml.c') diff --git a/xml.c b/xml.c index 0ab9f55..1e1b748 100644 --- a/xml.c +++ b/xml.c @@ -72,7 +72,6 @@ get_value(mxml_node_t *node, /* I - Node to get */ const char *whitespace_cb(mxml_node_t *node, int where) { /* code by Matt_P */ - char* nulled = { '\0' }; const char *name = node->value.element.name; mxml_node_t * temp = node; int depth = 0; @@ -81,12 +80,12 @@ const char *whitespace_cb(mxml_node_t *node, int where) temp = temp->parent; } if (where == 3 || where == 1){ - sprintf(xmlbuff, "%s", nulled); + return ""; }else if((node->prev && (where == 0 || node->parent)) && !(where == 2 && strncmp(name, "ua", 2) && strcmp(name, "flip") && strcmp(name, "zoom") && strcmp(name, "coords") && strcmp(name, "entries") && strcmp(name, "xmlyt") && strcmp(name, "xmlan") && strcmp(name, "entries") && strcmp(name, "triplet") && strcmp(name, "pair") && strcmp(name, "entry") && strcmp(name, "pane") && (strcmp(name, "tag") && strcmp(name, "size") && strcmp(name, "material") && strcmp(name, "colors") && strcmp(name, "subs") && strcmp(name, "font") && strcmp(name, "wnd4") && strcmp(name, "wnd4mat") && strcmp(name, "set") && strcmp(name, "coordinates"))) ){ sprintf(xmlbuff, "\n%*s", (depth-1)*4, ""); }else{ - sprintf(xmlbuff, "%s", nulled); + return ""; } - return (xmlbuff); + return xmlbuff; } -- cgit v1.3.1