aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keys/swkey.cpp4
-rw-r--r--src/modules/common/zverse.cpp3
-rw-r--r--src/modules/swmodule.cpp53
-rw-r--r--src/modules/texts/rawtext/rawtext.cpp4
4 files changed, 27 insertions, 37 deletions
diff --git a/src/keys/swkey.cpp b/src/keys/swkey.cpp
index e633369..307e848 100644
--- a/src/keys/swkey.cpp
+++ b/src/keys/swkey.cpp
@@ -59,7 +59,7 @@ SWKey::~SWKey() {
/******************************************************************************
* SWKey::Persist - Gets whether this object itself persists within a
- * module that it was used to SetKey or just a copy.
+ * module that it was used to setKey or just a copy.
* (1 - persists in module; 0 - a copy is attempted
*
* RET: value of persist
@@ -73,7 +73,7 @@ char SWKey::Persist() const
/******************************************************************************
* SWKey::Persist - Set/gets whether this object itself persists within a
- * module that it was used to SetKey or just a copy.
+ * module that it was used to setKey or just a copy.
* (1 - persists in module; 0 - a copy is attempted
*
* ENT: ipersist - value which to set persist
diff --git a/src/modules/common/zverse.cpp b/src/modules/common/zverse.cpp
index 6d76ddc..600a317 100644
--- a/src/modules/common/zverse.cpp
+++ b/src/modules/common/zverse.cpp
@@ -262,7 +262,8 @@ void zVerse::zreadtext(char testmt, long start, unsigned short size, char *inbuf
{
memset(inbuf, 0, size);
if (size > 2) {
- strncpy(inbuf, &(cacheBuf[start]), size-2);
+ if (cacheBuf)
+ strncpy(inbuf, &(cacheBuf[start]), size-2);
}
}
diff --git a/src/modules/swmodule.cpp b/src/modules/swmodule.cpp
index f37df27..b0e1002 100644
--- a/src/modules/swmodule.cpp
+++ b/src/modules/swmodule.cpp
@@ -256,20 +256,27 @@ char SWModule::Display()
/******************************************************************************
- * SWModule::SetKey - Sets a key to this module for position to a particular
- * record or set of records
+ * SWModule::getKey - Gets the key from this module that points to the position
+ * record
+ *
+ * RET: key object
+ */
+
+SWKey *SWModule::getKey() const {
+ return key;
+}
+
+
+/******************************************************************************
+ * SWModule::setKey - Sets a key to this module for position to a particular
+ * record
*
* ENT: ikey - key with which to set this module
*
* RET: error status
*/
-char SWModule::SetKey(const SWKey &ikey) {
- return SetKey(&ikey);
-}
-
-char SWModule::SetKey(const SWKey *ikey)
-{
+char SWModule::setKey(const SWKey *ikey) {
SWKey *oldKey = 0;
if (key) {
@@ -291,24 +298,6 @@ char SWModule::SetKey(const SWKey *ikey)
/******************************************************************************
- * SWModule::KeyText - Sets/gets module KeyText
- *
- * ENT: ikeytext - value which to set keytext
- * [0] - only get
- *
- * RET: pointer to keytext
- */
-
-const char *SWModule::KeyText(const char *ikeytext)
-{
- if (ikeytext)
- SetKey(ikeytext);
-
- return *key;
-}
-
-
-/******************************************************************************
* SWModule::setPosition(SW_POSITION) - Positions this modules to an entry
*
* ENT: p - position (e.g. TOP, BOTTOM)
@@ -405,7 +394,7 @@ ListKey &SWModule::Search(const char *istr, int searchType, int flags, SWKey *sc
searchkey = (scope)?scope->clone():(key->Persist())?key->clone():0;
if (searchkey) {
searchkey->Persist(1);
- SetKey(*searchkey);
+ setKey(*searchkey);
}
(*percent)(perc, percentUserData);
@@ -519,7 +508,7 @@ ListKey &SWModule::Search(const char *istr, int searchType, int flags, SWKey *sc
free(wordBuf);
}
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
@@ -605,11 +594,11 @@ const char *SWModule::StripText(char *buf, int len)
}
else savekey = key;
- SetKey(*tmpKey);
+ setKey(*tmpKey);
retVal = RenderText();
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
@@ -637,11 +626,11 @@ const char *SWModule::StripText(SWKey *tmpKey)
}
else savekey = key;
- SetKey(*tmpKey);
+ setKey(*tmpKey);
retVal = StripText();
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;
diff --git a/src/modules/texts/rawtext/rawtext.cpp b/src/modules/texts/rawtext/rawtext.cpp
index c2214f8..cfaaa37 100644
--- a/src/modules/texts/rawtext/rawtext.cpp
+++ b/src/modules/texts/rawtext/rawtext.cpp
@@ -142,7 +142,7 @@ signed char RawText::createSearchFramework() {
searchkey = (key->Persist())?key->clone():0;
if (searchkey) {
searchkey->Persist(1);
- SetKey(*searchkey);
+ setKey(*searchkey);
}
// position module at the beginning
@@ -174,7 +174,7 @@ signed char RawText::createSearchFramework() {
}
// reposition module back to where it was before we were called
- SetKey(*savekey);
+ setKey(*savekey);
if (!savekey->Persist())
delete savekey;