Skip to content

Commit 34c1f43

Browse files
committed
xml: fix segfault
1 parent 9d41078 commit 34c1f43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ xml_get_int(char *nodename)
184184
ctx.nodename = nodename;
185185
ctx.mode = XML_MODE_GETTING;
186186
xml_tree_walk(xmlDocGetRootElement(ctx.doc));
187-
return atoi(ctx.value);
187+
return ctx.value ? atoi(ctx.value) : 0;
188188
}
189189

190190
int

0 commit comments

Comments
 (0)