summaryrefslogtreecommitdiff
path: root/src/modules/filters/gbfwordjs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/filters/gbfwordjs.cpp')
-rw-r--r--src/modules/filters/gbfwordjs.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/filters/gbfwordjs.cpp b/src/modules/filters/gbfwordjs.cpp
index c9d1bd3..b0f352e 100644
--- a/src/modules/filters/gbfwordjs.cpp
+++ b/src/modules/filters/gbfwordjs.cpp
@@ -2,7 +2,7 @@
*
* gbfwordjs.cpp - SWFilter descendant for ???
*
- * $Id: gbfwordjs.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: gbfwordjs.cpp 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 2005-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -88,7 +88,7 @@ char GBFWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modul
token[0] = 0;
token[1] = 0;
token[2] = 0;
- textEnd = text.length();
+ textEnd = (unsigned int)text.length();
continue;
}
if (*from == '>') { // process tokens
@@ -137,7 +137,7 @@ char GBFWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modul
text += token;
text += '>';
if (needWordOut) {
- char wstr[10];
+ char wstr[11];
sprintf(wstr, "%03d", word-2);
AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
needWordOut = false;
@@ -212,27 +212,29 @@ char GBFWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modul
else m = morph.c_str();
spanStart.appendFormatted("<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','','%s');\" >", lexName.c_str(), strong.c_str(), wordID.c_str(), m, modName.c_str());
text.insert(textStr, spanStart);
- lastAppendLen = spanStart.length();
+ lastAppendLen = (unsigned int)spanStart.length();
}
}
}
if (newText) {
- textStart = text.length(); newText = false;
+ textStart = (unsigned int)text.length(); newText = false;
}
continue;
}
if (intoken) {
- if (tokpos < 2045)
+ if (tokpos < 2045) {
token[tokpos++] = *from;
+ // TODO: why is this + 2 ?
token[tokpos+2] = 0;
+ }
}
- else {
+ else {
text += *from;
}
}
- char wstr[10];
+ char wstr[11];
sprintf(wstr, "%03d", word-1);
AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
needWordOut = false;