summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@beryl-project.org>2007-03-26 23:27:18 +0200
committerDennis Kasprzyk <onestone@beryl-project.org>2007-03-26 23:27:18 +0200
commit4ae846274cf30e3914670f14c809438d7ebcf6a2 (patch)
treeb62c9d20dd050593a61da0efe824606c23280816
parentd512c39117e1b4c278622b233e03a4d8c94aef83 (diff)
downloadberyl-bcop-4ae846274cf30e3914670f14c809438d7ebcf6a2.tar.gz
beryl-bcop-4ae846274cf30e3914670f14c809438d7ebcf6a2.tar.bz2
handle empty default field
-rw-r--r--src/xml_parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xml_parser.c b/src/xml_parser.c
index e30d32c..2609e59 100644
--- a/src/xml_parser.c
+++ b/src/xml_parser.c
@@ -162,7 +162,7 @@ parseStringOption(xmlDoc *doc, xmlNode *node, Option *set)
{
if (!xmlStrcmp(cur->name, (const xmlChar *) "default")) {
xmlChar *key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
- set->data.asString.def = strdup((char *)key);
+ set->data.asString.def = strdup((key)?(char *)key:"");
xmlFree(key);
}
cur = cur->next;
@@ -177,7 +177,7 @@ parseMatchOption(xmlDoc *doc, xmlNode *node, Option *set)
{
if (!xmlStrcmp(cur->name, (const xmlChar *) "default")) {
xmlChar *key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
- set->data.asMatch.def = strdup((char *)key);
+ set->data.asMatch.def = strdup((key)?(char *)key:"");
xmlFree(key);
}
cur = cur->next;