Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
int count;
int want = 0;
int ret = -1;
- int i;
+ size_t i;
char **names = NULL;
/* List all interfaces, in case we might support new filter flags
ret = want;
cleanup:
- if (names)
+ if (names && count > 0)
for (i = 0; i < count; i++)
VIR_FREE(names[i]);
VIR_FREE(names);
int count = 0;
int want = 0;
int ret = -1;
- int i;
+ size_t i;
char **allnames = NULL;
count = ncf_num_of_interfaces(driver->netcf, status);
ret = want;
cleanup:
- if (allnames)
+ if (allnames && count > 0)
for (i = 0; i < count; i++)
VIR_FREE(allnames[i]);
VIR_FREE(allnames);
{
struct interface_driver *driver = conn->interfacePrivateData;
int count;
- int i;
+ size_t i;
struct netcf_if *iface = NULL;
virInterfacePtr *tmp_iface_objs = NULL;
virInterfacePtr iface_obj = NULL;
cleanup:
ncf_if_free(iface);
- if (names)
+ if (names && count > 0)
for (i = 0; i < count; i++)
VIR_FREE(names[i]);
VIR_FREE(names);
{
struct dirent **slave_list = NULL;
int slave_count = 0;
- int i;
+ size_t i;
const char *tmp_str;
int tmp_int;
return 0;
error:
- for (i = 0; i < slave_count; i++) {
+ for (i = 0; slave_count != -1 && i < slave_count; i++) {
VIR_FREE(slave_list[i]);
}
VIR_FREE(slave_list);
char *member_path;
const char *tmp_str;
int stp;
- int i;
+ size_t i;
/* Set our type to Bridge */
ifacedef->type = VIR_INTERFACE_TYPE_BRIDGE;
return 0;
error:
- for (i = 0; i < member_count; i++) {
+ for (i = 0; member_count != -1 && i < member_count; i++) {
VIR_FREE(member_list[i]);
}
VIR_FREE(member_list);