[sword-cvs] sword/src/keys treekeyidx.cpp,1.16,1.17

sword@www.crosswire.org sword@www.crosswire.org
Fri, 2 Apr 2004 16:54:48 -0700


Update of /cvs/core/sword/src/keys
In directory www:/tmp/cvs-serv28564/src/keys

Modified Files:
	treekeyidx.cpp 
Log Message:
Added SWBuf method setFormatted(). Altered all remaining uses of char[127] for file names to use SWBufs.

Index: treekeyidx.cpp
===================================================================
RCS file: /cvs/core/sword/src/keys/treekeyidx.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- treekeyidx.cpp	6 Feb 2004 21:01:00 -0000	1.16
+++ treekeyidx.cpp	2 Apr 2004 23:54:45 -0000	1.17
@@ -47,7 +47,7 @@
 }
 
 TreeKeyIdx::TreeKeyIdx(const char *idxPath, int fileMode) : currentNode() {
-	char buf[127];
+	SWBuf buf;
 
 	init();
 	path = 0;
@@ -61,13 +61,13 @@
 		fileMode = O_RDWR;
 	}
 		
-	sprintf(buf, "%s.idx", path);
+	buf.setFormatted("%s.idx", path);
 	idxfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
-	sprintf(buf, "%s.dat", path);
+	buf.setFormatted("%s.dat", path);
 	datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	if (datfd <= 0) {
-		sprintf(buf, "Error: %d", errno);
+		buf.setFormatted("Error: %d", errno);
 		perror(buf);
 		error = errno;
 	}