summaryrefslogtreecommitdiff
path: root/src/modules/filters/thmlwordjs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/filters/thmlwordjs.cpp')
-rw-r--r--src/modules/filters/thmlwordjs.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/filters/thmlwordjs.cpp b/src/modules/filters/thmlwordjs.cpp
index 7d80a00..2042453 100644
--- a/src/modules/filters/thmlwordjs.cpp
+++ b/src/modules/filters/thmlwordjs.cpp
@@ -2,7 +2,7 @@
*
* thmlwordjs.cpp - SWFilter descendant to ???
*
- * $Id: thmlwordjs.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: thmlwordjs.cpp 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 2005-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -68,7 +68,7 @@ char ThMLWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modu
char val[128];
char *valto;
char *ch;
- char wordstr[5];
+ char wordstr[11];
unsigned int textStart = 0, lastAppendLen = 0, textEnd = 0;
SWBuf tmp;
bool newText = false;
@@ -91,7 +91,7 @@ char ThMLWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modu
token[0] = 0;
token[1] = 0;
token[2] = 0;
- textEnd = text.length();
+ textEnd = (unsigned int)text.length();
continue;
}
if (*from == '>') { // process tokens
@@ -151,7 +151,7 @@ char ThMLWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modu
text += token;
text += '>';
if (needWordOut) {
- char wstr[10];
+ char wstr[11];
sprintf(wstr, "%03d", word-2);
AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
needWordOut = false;
@@ -226,27 +226,29 @@ char ThMLWordJS::processText(SWBuf &text, const SWKey *key, const SWModule *modu
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 {
text += *from;
}
}
- char wstr[10];
+ char wstr[11];
sprintf(wstr, "%03d", word-1);
AttributeValue *wAttrs = &(module->getEntryAttributes()["Word"][wstr]);
needWordOut = false;