This fixes compilation with -Wstrict-overflow=2.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
/* Complete command */
char **matches;
size_t len, samelen=0;
- int i, count=1;
+ size_t i, 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;