projects
/
SXSI
/
XMLTree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a984674
)
NextSibling() segfault when called on the root node, so add a check
author
kim
<kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 27 Jan 2009 00:04:58 +0000
(
00:04
+0000)
committer
kim
<kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 27 Jan 2009 00:04:58 +0000
(
00:04
+0000)
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
patch
|
blob
|
history
diff --git
a/XMLTree.cpp
b/XMLTree.cpp
index
92360a4
..
3c51b2f
100644
(file)
--- 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");
\r
exit(1);
\r
}
\r
-
\r
+ if (x == Root())
\r
+ return NULLT;
\r
+
\r
return next_sibling(Par, x);
\r
}
\r
\r