summaryrefslogtreecommitdiff
path: root/src/mediaxml.c
diff options
context:
space:
mode:
authorNick White <arch@njw.me.uk>2008-04-02 22:20:24 +0000
committerNick White <arch@njw.me.uk>2008-04-02 22:20:24 +0000
commit54160445284875eee9ed85d513791b193a076d0b (patch)
treedf991e30a202c4cc3393e98977a9c34a6a09ce48 /src/mediaxml.c
parent8e189aaac36056e58b08573c6c57f8dabf1ef905 (diff)
Fix for media xml crash bugs
Formatting Check for empty item titles Created function to check if any part of a string contains a phrase Added some basic error checking to getquote Note this does not completely fix all problems git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-31
Diffstat (limited to 'src/mediaxml.c')
-rw-r--r--src/mediaxml.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mediaxml.c b/src/mediaxml.c
index 02c2cad..54ed3ae 100644
--- a/src/mediaxml.c
+++ b/src/mediaxml.c
@@ -228,7 +228,10 @@ iss ** parsemedia(char * filepath, iss ** issue, int * no_of_issues)
if(xmlGetProp(itnode, "preview"))
strncpy(cur_media->preview_uri, (char *) xmlGetProp(itnode, "preview_uri"), STR_MAX);
- strncpy(cur_media->title, (char *) xmlNodeListGetString(media_file, itnode->xmlChildrenNode, 1), STR_MAX);
+ if((char *) xmlNodeListGetString(media_file, itnode->xmlChildrenNode, 1))
+ strncpy(cur_media->title, (char *) xmlNodeListGetString(media_file, itnode->xmlChildrenNode, 1), STR_MAX);
+ else
+ strncpy(cur_media->title, "untitled", STR_MAX);
}
itnode = itnode->next;