浏览代码

switched string::compare to strncmp

Phil Pritchett 24 年之前
父节点
当前提交
8476330979
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Source/cmDSPWriter.cxx
  2. 1 1
      Source/cmDSWWriter.cxx

+ 1 - 1
Source/cmDSPWriter.cxx

@@ -128,7 +128,7 @@ void cmDSPWriter::OutputDSPFile()
     // so don't build a projectfile for it
     // so don't build a projectfile for it
     if ((l->second.GetType() != cmTarget::INSTALL_FILES)
     if ((l->second.GetType() != cmTarget::INSTALL_FILES)
         && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
         && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
-        && (l->first.compare(0,26, "INCLUDE_EXTERNAL_MSPROJECT") != 0))
+        && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
       {
       {
       this->CreateSingleDSP(l->first.c_str(),l->second);
       this->CreateSingleDSP(l->first.c_str(),l->second);
       }
       }

+ 1 - 1
Source/cmDSWWriter.cxx

@@ -172,7 +172,7 @@ void cmDSWWriter::WriteDSWFile(std::ostream& fout)
           }
           }
         }
         }
       // Write the project into the DSW file
       // Write the project into the DSW file
-      if (l->first.compare(0,26, "INCLUDE_EXTERNAL_MSPROJECT") == 0)
+      if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
       {
       {
         cmCustomCommand cc = l->second.GetCustomCommands()[0];
         cmCustomCommand cc = l->second.GetCustomCommands()[0];