Browse Source

HPCC-23067 Fix issues with strcmp/stricmp

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 5 years ago
parent
commit
eac398953f

+ 1 - 1
common/thorhelper/thorsoapcall.cpp

@@ -884,7 +884,7 @@ public:
         if (wscType == SThttp)
         {
             service.toUpperCase();  //GET/PUT/POST
-            if (strcmp(service.str(), "GET"))
+            if (strcmp(service.str(), "GET") != 0)
                 throw MakeStringException(0, "HTTPCALL Only 'GET' http method currently supported");
             OwnedRoxieString acceptTypeSupplied(helper->getAcceptType()); // text/html, text/xml, etc
             acceptType.set(acceptTypeSupplied);

+ 1 - 1
common/workunit/pkgimpl.hpp

@@ -57,7 +57,7 @@ public:
     {
         ForEachItemIn(idx, subFiles)
         {
-            if (stricmp(subFiles.item(idx).queryProp("@value"), subname))
+            if (strieq(subFiles.item(idx).queryProp("@value"), subname))
                 return idx;
         }
         return NotFound;

+ 1 - 1
dali/base/dafdesc.cpp

@@ -82,7 +82,7 @@ bool getCrcFromPartProps(IPropertyTree &fileattr,IPropertyTree &props, unsigned
     }
     // NB: old @crc keys and compressed were not crc of file but of data within.
     const char *kind = props.queryProp("@kind");
-    if (kind&&strcmp(kind,"key")) // key part
+    if (strsame(kind,"key")) // key part
         return false;
     bool blocked;
     if (isCompressed(fileattr,&blocked)) {

+ 1 - 1
deployment/envgen2/EnvGen.cpp

@@ -489,7 +489,7 @@ void CEnvGen::addUpdateAttributesFromString(IPropertyTree *updateTree, const cha
      sbValue.replaceString("[equal]", "=");
 
      StringArray newOldValues;
-     if (strcmp(keyValues[1], ""))
+     if (strcmp(keyValues[1], "") != 0)
      {
         newOldValues.appendList(sbValue.str(), ATTR_V_SEP);
         pAttr->addProp("@value", newOldValues[0]);

+ 1 - 1
esp/esdllib/esdl_transformer2.cpp

@@ -222,7 +222,7 @@ void Esdl2Base::serialize_attributes(StringBuffer &out)
         const char *key = piter->getPropKey();
         if (key && *key)
         {
-            if (stricmp(key, "base_type"))
+            if (stricmp(key, "base_type") != 0)
             {
                 const char *value = m_def->queryProp(key);
                 if (value && *value)

+ 1 - 1
esp/services/WsDeploy/WsDeployService.cpp

@@ -339,7 +339,7 @@ bool CWsDeployFileInfo::navMenuEvent(IEspContext &context,
     if (!strcmp(sbName.str(), m_userWithLock.str()) && !strcmp(sbUserIp.str(), m_userIp.str()))
       throw MakeStringException(-1, "Another browser window already has write access on machine '%s'. Please use that window.", sbUserIp.str());
   }  
-  else if (strcmp(cmd, "SaveEnvironmentAs"))
+  else if (strcmp(cmd, "SaveEnvironmentAs") != 0)
     checkForRefresh(context, &req.getReqInfo(), true);
 
   if (!stricmp(cmd, "Deploy"))

+ 1 - 1
esp/services/ws_dfu/ws_dfuService.cpp

@@ -516,7 +516,7 @@ bool CWsDfuEx::onDFUSpace(IEspContext &context, IEspDFUSpaceRequest & req, IEspD
         else
         {
             Owned<IEspSpaceItem> item64 = createSpaceItem();
-            if (stricmp(countby, COUNTBY_OWNER))
+            if (!strieq(countby, COUNTBY_OWNER))
             {
                 if (scopeName)
                     item64->setName(scopeName);

+ 2 - 2
roxie/ccd/ccdcontext.cpp

@@ -2660,13 +2660,13 @@ public:
         if (running)
             throw MakeStringException(ROXIE_DEBUG_ERROR, "Command not available while query is running");
         output->outputBeginNested("Variables", true);
-        if (!type || stricmp(type, "temporary"))
+        if (!type || strieq(type, "temporary"))
         {
             output->outputBeginNested("Temporary", true);
             ctx->printResults(output, name, (unsigned) ResultSequenceInternal);
             output->outputEndNested("Temporary");
         }
-        if (!type || stricmp(type, "global"))
+        if (!type || strieq(type, "global"))
         {
             output->outputBeginNested("Global", true);
             ctx->printResults(output, name, (unsigned) ResultSequenceStored);

+ 1 - 1
roxie/ccd/ccdfile.cpp

@@ -1984,7 +1984,7 @@ public:
     {
         ForEachItemIn(idx, subNames)
         {
-            if (stricmp(subNames.item(idx), subname))
+            if (strieq(subNames.item(idx), subname))
                 return idx;
         }
         return NotFound;

+ 1 - 1
roxie/ccd/ccdstate.cpp

@@ -271,7 +271,7 @@ public:
     {
         ForEachItemIn(idx, subFiles)
         {
-            if (stricmp(subFiles.item(idx).queryProp("@value"), subname))
+            if (strieq(subFiles.item(idx).queryProp("@value"), subname))
                 return idx;
         }
         return NotFound;

+ 1 - 1
tools/esdlcmd/esdl2ecl.cpp

@@ -71,7 +71,7 @@ public:
             if (typeEntry && *typeEntry)
             {
                 const char *src = (*typeEntry)->src.get();
-                if (stricmp(src, localsrc))
+                if (stricmp(src, localsrc) != 0)
                 {
                     const char *finger = src;
                     if (!strnicmp(finger, "wsm_", 4))