瀏覽代碼

HPCC-10552 A few more one-off errors reported by Coverity

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 11 年之前
父節點
當前提交
b697c40321

+ 1 - 1
common/thorhelper/thortalgo.cpp

@@ -177,7 +177,7 @@ void ProductionFeatureInfo::deserialize(MemoryBuffer & in)
     extra.deserialize(in);
     unsigned numActions;
     in.read(numActions);
-    for (unsigned i = 0; i < numActions; numActions++)
+    for (unsigned i = 0; i < numActions; i++)
     {
         FeatureAction & cur = * new FeatureAction;
         cur.deserialize(in);

+ 1 - 1
dali/dalidiag/dalidiag.cpp

@@ -194,7 +194,7 @@ void timeQorSDS(bool timeq)
             }   
             a /= s;
             if (last10av>0.0) {
-                if (a>last10av+MININC) last10inc='+'; else if (a<last10av-MININC) last10inc='-'; else last100inc=' ';
+                if (a>last10av+MININC) last10inc='+'; else if (a<last10av-MININC) last10inc='-'; else last10inc=' ';
             }
             last10av = a;
             last10max = m;

+ 1 - 1
ecl/hqlcpp/hqlwcpp.cpp

@@ -515,7 +515,7 @@ void HqlCppWriter::generateType(ITypeInfo * type, const char * name)
             //recurse to child type
             break;
         case type_void:
-        case no_any:
+        case type_any:
             prefix = "void";
             break;
         case type_set:

+ 2 - 2
system/security/zcrypt/base64.cpp

@@ -26,7 +26,7 @@ static const char pad = '=';
 ZBuffer& base64_encode(int length, const void *data, ZBuffer& result)
 {
     int estlen = (int)(length*4.0/3.0 + (length / 54) + 8);
-    char *out  = new char[estlen];
+    unsigned char *out  = (unsigned char *)malloc(estlen);
 
     const unsigned char *in = static_cast<const unsigned char *>(data);
 
@@ -81,7 +81,7 @@ ZBuffer& base64_encode(int length, const void *data, ZBuffer& result)
     out[j++] = '\n';
     out[j] = '\0';
 
-    result.setBuffer(j, (unsigned char*)out);
+    result.setBuffer(j, out);
 
     return result;
 }

+ 1 - 1
tools/hidl/hidlcomp.cpp

@@ -4929,7 +4929,7 @@ void EspMessageInfo::write_esp()
     if (parent)
     {
         outf("\nbool C%s::unserialize(IEspContext* ctx, CSoapValue& soapval, bool localOnly)\n{\n", name_);
-        outf("bool hasValue = false;\n");
+        outf("\tbool hasValue = false;\n");
         outf("\tif(!localOnly)\n");
         outf("\t\thasValue |= C%s::unserialize(ctx,soapval);\n", parent);
     }