mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-17 18:45:42 +00:00
examples/elements.c: Be consistent across examples regarding OOM detection
This commit is contained in:
parent
894b98d9b3
commit
77409cde88
1 changed files with 5 additions and 0 deletions
|
@ -82,6 +82,11 @@ main(void) {
|
|||
int done;
|
||||
int depth = 0;
|
||||
|
||||
if (! parser) {
|
||||
fprintf(stderr, "Couldn't allocate memory for parser\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
XML_SetUserData(parser, &depth);
|
||||
XML_SetElementHandler(parser, startElement, endElement);
|
||||
do {
|
||||
|
|
Loading…
Add table
Reference in a new issue