[sword-svn] r2944 - in trunk: include src/modules

scribe at crosswire.org scribe at crosswire.org
Sat Aug 3 02:43:40 MST 2013


Author: scribe
Date: 2013-08-03 02:43:40 -0700 (Sat, 03 Aug 2013)
New Revision: 2944

Modified:
   trunk/include/swmodule.h
   trunk/src/modules/swmodule.cpp
Log:
fixed signature for safety


Modified: trunk/include/swmodule.h
===================================================================
--- trunk/include/swmodule.h	2013-08-03 09:15:48 UTC (rev 2943)
+++ trunk/include/swmodule.h	2013-08-03 09:43:40 UTC (rev 2944)
@@ -202,7 +202,7 @@
 	 * @param bibFormat format of the bibliographic data
 	 * @return bibliographic data in the requested format as a string (BibTeX by default)
 	 */
-	virtual const char *getBibliography(unsigned char bibFormat = BIB_BIBTEX) const;
+	virtual SWBuf getBibliography(unsigned char bibFormat = BIB_BIBTEX) const;
 
 	/**
 	 * @return The size of the text entry for the module's current key position.

Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2013-08-03 09:15:48 UTC (rev 2943)
+++ trunk/src/modules/swmodule.cpp	2013-08-03 09:43:40 UTC (rev 2944)
@@ -930,11 +930,11 @@
  * RET: bibliographic data in the requested format as a string (BibTeX by default)
  */
 
-const char *SWModule::getBibliography(unsigned char bibFormat) const {
+SWBuf SWModule::getBibliography(unsigned char bibFormat) const {
 	SWBuf s;
 	switch (bibFormat) {
 	case BIB_BIBTEX:
-		s = SWBuf("@Book {") + (SWBuf) modname + SWBuf(", Title = \"") + (SWBuf) moddesc + SWBuf("\", Publisher = \"CrossWire Bible Society\"}");
+		s.append("@Book {").append(modname).append(", Title = \"").append(moddesc).append("\", Publisher = \"CrossWire Bible Society\"}");
 		break;
 	}
 	return s;




More information about the sword-cvs mailing list