summaryrefslogtreecommitdiff
path: root/libexslt
diff options
context:
space:
mode:
Diffstat (limited to 'libexslt')
-rw-r--r--libexslt/strings.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libexslt/strings.c b/libexslt/strings.c
index e4eb3eab..192d0c4a 100644
--- a/libexslt/strings.c
+++ b/libexslt/strings.c
@@ -589,15 +589,14 @@ exsltStrReplaceFunction (xmlXPathParserContextPtr ctxt, int nargs) {
}
str = xmlXPathPopString(ctxt);
- ret = xmlStrdup(str);
+ ret = xmlStrdup(str);
- for (i = 0; i < searchSet->nodeNr; i++) {
-
- searchStr = xmlXPathCastNodeToString(searchSet->nodeTab[i]);
+ for (i = 0; i < searchSet->nodeNr; i++) {
+ searchStr = xmlXPathCastNodeToString(searchSet->nodeTab[i]);
if (replaceSet != NULL) {
replaceStr = NULL;
- if (i <= replaceSet->nodeNr) {
+ if (i < replaceSet->nodeNr) {
replaceStr = xmlXPathCastNodeToString(replaceSet->nodeTab[i]);
}