[sword-svn] r2669 - trunk/src/keys
scribe at crosswire.org
scribe at crosswire.org
Sat Nov 12 12:47:33 MST 2011
Author: scribe
Date: 2011-11-12 12:47:33 -0700 (Sat, 12 Nov 2011)
New Revision: 2669
Modified:
trunk/src/keys/versekey.cpp
Log:
added assert to be sure setIndex was passed something sane
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2011-11-12 17:35:32 UTC (rev 2668)
+++ trunk/src/keys/versekey.cpp 2011-11-12 19:47:33 UTC (rev 2669)
@@ -1612,6 +1612,12 @@
void VerseKey::setIndex(long iindex)
{
+ // assert we're sane
+ if (iindex < 0) {
+ error = KEYERR_OUTOFBOUNDS;
+ return;
+ }
+
int b;
error = refSys->getVerseFromOffset(iindex, &b, &chapter, &verse);
book = (unsigned char)b;
More information about the sword-cvs
mailing list