openbsd-ports/databases/gq/patches/patch-src_xmlparse_c
jasper 33b462f0c0 - regen WANTLIB
- install .desktop file where it should
- add missing goo and dependency
- get rid of implicit declaration warnings
- add missing rcs id's to several patches

ok mbalmer@ (MAINTAINER), sthen@
2009-01-26 18:17:25 +00:00

26 lines
714 B
Plaintext

$OpenBSD: patch-src_xmlparse_c,v 1.3 2009/01/26 18:17:25 jasper Exp $
--- 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 */