summaryrefslogtreecommitdiff
path: root/src/modules/filters/gbfthml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/filters/gbfthml.cpp')
-rw-r--r--src/modules/filters/gbfthml.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/filters/gbfthml.cpp b/src/modules/filters/gbfthml.cpp
index 303b240..d3dd611 100644
--- a/src/modules/filters/gbfthml.cpp
+++ b/src/modules/filters/gbfthml.cpp
@@ -2,7 +2,7 @@
*
* gbfthml.cpp - GBF to ThML filter
*
- * $Id: gbfthml.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: gbfthml.cpp 3427 2016-07-03 14:30:33Z scribe $
*
* Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -52,8 +52,7 @@ char GBFThML::processText(SWBuf &text, const SWKey *key, const SWModule *module)
token[2] = 0;
continue;
}
- if (*from == '>')
- {
+ if (*from == '>') {
intoken = false;
// process desired tokens
switch (*token) {
@@ -210,9 +209,15 @@ char GBFThML::processText(SWBuf &text, const SWKey *key, const SWModule *module)
continue;
}
if (intoken) {
- if (tokpos < 2045)
+ if (tokpos < 2045) {
token[tokpos++] = *from;
+ //TODO: why is this + 2? Are we trying to keep 2 or 3 nulls after the last valid char?
+ // tokpos has been incremented past the last valid token. it should be pointing to null
+ // +1 should give us 2 nulls, but we're +2 here, which actually keeps 3 nulls after the
+ // last valid char. Why are we doing any of this? These were written before SWBuf and should
+ // probably be switched to SWBuf, but perf tests before and after the switch should be run
token[tokpos+2] = 0;
+ }
}
else text += *from;
}