[sword-devel] Bug in Torrey Module / RawLd.cpp

Torsten Uhlmann sword-devel@crosswire.org
16 Jan 2000 18:09:26 +0100


Hi,
according to a mail in sword-support, the module Torrey does not work
with BibleTime. I verified this and it is true. Though it _does_ work
with cheatah. The seg fault occurs in rawld.cpp (changed member
attached). Since all other modules work this way I would ask you to look
into the Torrey module whether there are keys that have no text or
something. The problem is, the driver doe not return any text for a
given (probably wrong) key. cheatah gives an empty key when first
displaying the module thats why it works there.

I changed the sword-1.5.x branch. I don't know if the patch is according
to your design rules, but please have a look at the problem
anyway. Thanks.
So here's my hyper smart patch :)

/******************************************************************************
 * RawLD::operator char *	- Returns the correct entry when char * cast
 *							is requested
 *
 * RET: string buffer with entry
 */

RawLD::operator char*()
{
	getEntry();
	if (!entrybuf) {
		entrybuf = new char [ 1 ];
		entrybuf[0] = '\0';
	} else {
		preptext(entrybuf);
		RenderText(entrybuf, strlen(entrybuf) * 2);
	}
	return entrybuf;
}


-- 

best regards,
Torsten Uhlmann

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TUhlmann@gmx.de
TUhlmann@debis.com

http://www.tuhlmann.purespace.de
http://www.bibletime.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wise men still seek him!