fix stuff found by cppcheck

almost 3000 lines of "errors" contained one actual memleak, one actually
unused variable and three actual ambiguous code parts

from cppcheck website: "The goal is to detect only real errors in the
 code (i.e. have zero false positives)." :)

thx for finding five problems in our code
This commit is contained in:
ac-stef
2017-06-17 12:40:35 +02:00
parent f33b9c0dba
commit 03e21b097d
8 changed files with 10 additions and 12 deletions
+1 -1
View File
@@ -305,7 +305,7 @@ void processdownload(package *pck, stream *f) // write downloaded data to file(s
else
{ // any name with listed extension, written to subdirectory
int zlen = (int)strlen(zname), elen = (int)strlen(pck->exts[n]);
if((isok = zlen > elen && !strcmp(zname + zlen - elen, pck->exts[n]))) formatstring(filename)("%s/%s", pck->fullpath, zname);
if((isok = (zlen > elen && !strcmp(zname + zlen - elen, pck->exts[n])))) formatstring(filename)("%s/%s", pck->fullpath, zname);
}
if(isok) break;
}