opnsense-ports/deskutils/libgcal/files/patch-src_atom_parser.c
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

32 lines
1.1 KiB
C

--- src/atom_parser.c.orig 2010-06-20 20:26:34.000000000 +0200
+++ src/atom_parser.c 2011-02-24 12:28:51.710766352 +0100
@@ -282,7 +282,8 @@ static int extract_and_check_multi(xmlDo
if (attr2) {
if (xmlHasProp(node->nodeTab[i], attr2)) {
tmp = xmlGetProp(node->nodeTab[i], attr2);
- (*types)[i] = strdup(strchr(tmp,'#') + 1);
+ if (strchr(tmp,'#'))
+ (*types)[i] = strdup(strchr(tmp,'#') + 1);
xmlFree(tmp);
}
else
@@ -292,7 +293,8 @@ static int extract_and_check_multi(xmlDo
if (attr3) {
if (xmlHasProp(node->nodeTab[i], attr3)) {
tmp = xmlGetProp(node->nodeTab[i], attr3);
- (*protocols)[i] = strdup(strchr(tmp,'#') + 1);
+ if (strchr(tmp,'#'))
+ (*protocols)[i] = strdup(strchr(tmp,'#') + 1);
xmlFree(tmp);
}
else
@@ -383,7 +385,8 @@ static int extract_and_check_multisub(xm
if (attr1) {
if (xmlHasProp(node->nodeTab[i], attr1)) {
tmp = xmlGetProp(node->nodeTab[i], attr1);
- (*types)[i] = strdup(strchr(tmp,'#') + 1);
+ if (strchr(tmp,'#'))
+ (*types)[i] = strdup(strchr(tmp,'#') + 1);
xmlFree(tmp);
} else
(*types)[i] = strdup("");