This fixes compilation with -Wstrict-overflow=2.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
return NULL;
} else {
char **matches;
- int i, len, samelen = 0, count=1;
+ size_t i, len, samelen = 0, count=1;
matches = malloc_array_p(char *, MAX_COMPLETIONS);
if (!matches) return NULL;
return matches;
cleanup:
- count--;
- while (count >= 0) {
- free(matches[count]);
- count--;
+ for (i = 0; i < count; i++) {
+ free(matches[i]);
}
free(matches);
return NULL;