[commit] r2390 - in trunk/GME: Gme Search XmlBackEnd

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Oct 17 15:20:01 CDT 2013


Author: ksmyth
Date: Thu Oct 17 15:20:01 2013
New Revision: 2390

Log:
GME-427 range-checking, logic bugs

Modified:
   trunk/GME/Gme/GUIObject.cpp
   trunk/GME/Search/ComHelp.cpp
   trunk/GME/XmlBackEnd/CoreXmlFile.cpp

Modified: trunk/GME/Gme/GUIObject.cpp
==============================================================================
--- trunk/GME/Gme/GUIObject.cpp	Thu Oct 17 15:19:48 2013	(r2389)
+++ trunk/GME/Gme/GUIObject.cpp	Thu Oct 17 15:20:01 2013	(r2390)
@@ -2354,7 +2354,7 @@
 CPoint CGuiConnectionLabelSet::GetLocation(int index) const
 {
 	CPoint pt(-1, -1);
-	if (index >= 0 || index < GME_CONN_LABEL_NUM)
+	if (index >= 0 && index < GME_CONN_LABEL_NUM)
 		pt = labels[index].GetLocation();
 	return pt;
 }
@@ -2362,7 +2362,7 @@
 int CGuiConnectionLabelSet::GetAlignment(int index) const
 {
 	int alignment = 0;
-	if (index >= 0 || index < GME_CONN_LABEL_NUM)
+	if (index >= 0 && index < GME_CONN_LABEL_NUM)
 		alignment = labels[index].GetAlignment();
 	return alignment;
 }
@@ -2370,7 +2370,7 @@
 CString CGuiConnectionLabelSet::GetLabel(int index) const
 {
 	CString label;
-	if (index >= 0 || index < GME_CONN_LABEL_NUM)
+	if (index >= 0 && index < GME_CONN_LABEL_NUM)
 		label = labels[index].GetLabel();
 	return label;
 }

Modified: trunk/GME/Search/ComHelp.cpp
==============================================================================
--- trunk/GME/Search/ComHelp.cpp	Thu Oct 17 15:19:48 2013	(r2389)
+++ trunk/GME/Search/ComHelp.cpp	Thu Oct 17 15:20:01 2013	(r2390)
@@ -13,7 +13,7 @@
 
 	long bound;
 
-	ASSERT( (*ppsa)->fFeatures | FADF_UNKNOWN );
+	ASSERT( (*ppsa)->fFeatures & FADF_UNKNOWN );
 	ASSERT( (*ppsa)->cbElements == sizeof(IUnknown*) );
 	ASSERT( SafeArrayGetDim(*ppsa) == 1 );
 	COMASSERT(SafeArrayGetLBound(*ppsa, 1, &bound));
@@ -94,7 +94,7 @@
 {
 	ASSERT(psa);
 
-	ASSERT( psa->fFeatures | FADF_UNKNOWN );
+	ASSERT( psa->fFeatures & FADF_UNKNOWN );
 	ASSERT( psa->cbElements == sizeof(IUnknown*) );
 
 	psa->fFeatures &= ~FADF_UNKNOWN;

Modified: trunk/GME/XmlBackEnd/CoreXmlFile.cpp
==============================================================================
--- trunk/GME/XmlBackEnd/CoreXmlFile.cpp	Thu Oct 17 15:19:48 2013	(r2389)
+++ trunk/GME/XmlBackEnd/CoreXmlFile.cpp	Thu Oct 17 15:20:01 2013	(r2390)
@@ -1608,7 +1608,7 @@
 		// Check for the new session folder, create one on-demand
 		std::string sessionFolder =  m_folderPath + "\\" + HelperFiles::sessionFolderName;
 		DWORD atts = ::GetFileAttributes(sessionFolder.c_str());
-		if (atts == INVALID_FILE_ATTRIBUTES || !(atts | FILE_ATTRIBUTE_DIRECTORY) ) {
+		if (atts == INVALID_FILE_ATTRIBUTES || !(atts & FILE_ATTRIBUTE_DIRECTORY) ) {
 			sendMsg( "Detecting old session format. Upgrading to newer one (dedicated session folder).", MSG_INFO);
 			
 			BOOL  succ = ::CreateDirectory( sessionFolder.c_str(), NULL);


More information about the gme-commit mailing list