summaryrefslogtreecommitdiff
path: root/mediaxml.c
diff options
context:
space:
mode:
authorNick White <arch@njw.me.uk>2007-03-04 23:42:25 +0000
committerNick White <arch@njw.me.uk>2007-03-04 23:42:25 +0000
commit9548ce6885325c0772cf3d83ad40076844d4d846 (patch)
tree20686cef1c437ee8badc1347b819020dd2eaacb7 /mediaxml.c
parentfd2024792f768e6c347c345468c84b152a62bb11 (diff)
Fixed bug causing segfault if -a -n/m were passed together
Issue structure was passed incorrectly to parsemedia Fixed fill correct issue(s) if it already exists Added default no_of_media to -1 git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-4
Diffstat (limited to 'mediaxml.c')
-rw-r--r--mediaxml.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mediaxml.c b/mediaxml.c
index 60d4576..b9631e2 100644
--- a/mediaxml.c
+++ b/mediaxml.c
@@ -190,10 +190,11 @@ iss ** parsemedia(char * filepath, iss ** issue, int * no_of_issues)
strncpy(issue[*no_of_issues]->title, (char *) xmlGetProp(node, "title"), STR_MAX);
- issue[*no_of_issues]->no_of_media = -1;
+ tmp = *no_of_issues;
}
- cur_media = issue[(*no_of_issues)]->media;
+ issue[tmp]->no_of_media = -1;
+ cur_media = issue[tmp]->media;
itnode = node->xmlChildrenNode;
@@ -215,7 +216,7 @@ iss ** parsemedia(char * filepath, iss ** issue, int * no_of_issues)
strncpy(cur_media->title, (char *) xmlNodeListGetString(media_file, itnode->xmlChildrenNode, 1), STR_MAX);
- issue[*no_of_issues]->no_of_media++;
+ issue[tmp]->no_of_media++;
cur_media++;
}