diff options
author | Teus Benschop <teusjannette@gmail.com> | 2018-10-28 11:51:26 +0100 |
---|---|---|
committer | Teus Benschop <teusjannette@gmail.com> | 2018-10-28 11:51:26 +0100 |
commit | 1d0ff54794b5edea7cdf1d2d66710a0fa885bcc5 (patch) | |
tree | 8ece5f9ef437fbb151f2b22ed0c6e1a714879c7c /src/modules/filters/gbfthml.cpp | |
parent | c7dbdc9161a7c460526b80fe01af49d714856126 (diff) |
New upstream version 1.8.1
Diffstat (limited to 'src/modules/filters/gbfthml.cpp')
-rw-r--r-- | src/modules/filters/gbfthml.cpp | 13 |
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; } |