From 9b3825663e88360c57dfe66cee5330f8f80fb452 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 27 Jan 2009 00:04:58 +0000 Subject: [PATCH] NextSibling() segfault when called on the root node, so add a check and retrung NULLT if the argument is ther root node. It's consistent with the behaviour of calling FirstChild on a leaf node. git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@65 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- XMLTree.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XMLTree.cpp b/XMLTree.cpp index 92360a4..3c51b2f 100644 --- a/XMLTree.cpp +++ b/XMLTree.cpp @@ -345,7 +345,9 @@ treeNode XMLTree::NextSibling(treeNode x) fprintf(stderr, "Error: data structure has not been constructed properly\n"); exit(1); } - + if (x == Root()) + return NULLT; + return next_sibling(Par, x); } -- 2.17.1