[sword-svn] r3818 - in trunk/src: mgr modules/common

scribe at crosswire.org scribe at crosswire.org
Mon Oct 19 09:41:05 EDT 2020


Author: scribe
Date: 2020-10-19 09:41:05 -0400 (Mon, 19 Oct 2020)
New Revision: 3818

Modified:
   trunk/src/mgr/filemgr.cpp
   trunk/src/modules/common/swcomprs.cpp
Log:
Fix FileMgr::hasAccess to use mode parameter instead of hardcoded 04
Added guard len != null before *len =... in SWCompress::getUncompressedBuf
-- Thanks Jaak!


Modified: trunk/src/mgr/filemgr.cpp
===================================================================
--- trunk/src/mgr/filemgr.cpp	2020-10-19 11:00:49 UTC (rev 3817)
+++ trunk/src/mgr/filemgr.cpp	2020-10-19 13:41:05 UTC (rev 3818)
@@ -327,9 +327,9 @@
 bool FileMgr::hasAccess(const char *path, int mode) {
 	return
 #ifdef WIN32
-		!_waccess((const wchar_t *)utf8ToWChar(path).getRawData(), 04);
+		!_waccess((const wchar_t *)utf8ToWChar(path).getRawData(), mode);
 #else
-		!access(path, 04);
+		!access(path, mode);
 #endif
 }
 

Modified: trunk/src/modules/common/swcomprs.cpp
===================================================================
--- trunk/src/modules/common/swcomprs.cpp	2020-10-19 11:00:49 UTC (rev 3817)
+++ trunk/src/modules/common/swcomprs.cpp	2020-10-19 13:41:05 UTC (rev 3818)
@@ -83,7 +83,7 @@
 		buf = (char *)calloc(1,1); // be sure we at least allocate an empty buf for return;
 		direct = 1;
 		decode();
-		*len = slen;
+		if (len) *len = slen;
 	}
 }
 



More information about the sword-cvs mailing list