openbsd-ports/databases/gq/patches/patch-src_xmlparse_c
ajacoutot ad77f30d1f - tweak .desktop file so that we have an icon to show in the GNOME menu
- precise license marker
- add sysutils to CATEGORIES
- regen patches and PLIST while here

ok mbalmer@
2008-10-12 17:36:03 +00:00

25 lines
644 B
Plaintext

--- src/xmlparse.c.orig Mon Nov 3 22:05:18 2003
+++ src/xmlparse.c Sun Oct 12 17:01:58 2008
@@ -51,7 +51,7 @@
#include "xmlparse.h"
#define malloc g_malloc
-#define calloc(n,s) g_malloc0(n * s)
+#define calloc(n,s) g_malloc0((n) * (s))
#define TAGSTACK_INCR 20
@@ -162,10 +162,11 @@ static void startElementH(struct parser_context *ctx,
e->attrs = NULL;
if (attrs) {
for (i = 0 ; attrs[i] ; i++) ;
- e->attrs = calloc(i, sizeof(xmlChar *));
+ e->attrs = calloc(i+1, sizeof(xmlChar *));
for (i = 0 ; attrs[i] ; i++) {
e->attrs[i] = strdup(attrs[i]);
}
+ e->attrs[i] = NULL;
}
/* lookup handler */