int count1 = count();
int count2 = toCompare.count();
int maxIx = count1 > count2 ? count2 : count1;
- for (size_t ix = 0; rc == -1 && ix < maxIx; ix++){
+ for (size_t ix = 0; rc == -1 && (int) ix < maxIx; ix++){
if (sizeOf(ix) != toCompare.sizeOf(ix)
|| strcmp(strOf(ix), toCompare.strOf(ix)) != 0)
rc = (int) ix;
int ixLine = line1.firstDifference(list2.strOf(ix), list2.strLengthOf(ix));
logF(true, i18n("%s-%d: Files differ in line %d-%d\n%s\n%s\n%s"),
m_sourceFile.str(), lineNo, ix, ixLine,
- list1.count() > ix ? list1.strOf(ix) : "",
- list2.count() > ix ? list2.strOf(ix) : "",
+ (int) list1.count() > ix ? list1.strOf(ix) : "",
+ (int) list2.count() > ix ? list2.strOf(ix) : "",
colMarker(ixLine));
}
*/
void ReDirOptions::addCompoundUsage(const char** usage){
int start = 0;
- while(m_compoundUsage[start] != NULL)
- assert(++start < m_countCompoundUsage);
+ while(m_compoundUsage[start] != NULL){
+ if (++start >= m_countCompoundUsage)
+ assert(false);
+ }
for (int ix = 0; usage[ix] != NULL; ix++){
- assert(start + ix < m_countCompoundUsage);
+ if (start + ix > m_countCompoundUsage){
+ assert(false);
+ break;
+ }
m_compoundUsage[start + ix] = usage[ix];
}
}