pr " return rv.ret.%s; /* caller will free */\n" n
| RStringList n ->
pr " /* caller will free this, but we need to add a NULL entry */\n";
- pr " rv.ret.%s.%s_val = safe_realloc (g, rv.ret.%s.%s_val, rv.ret.%s.%s_len + 1);\n" n n n n n n;
+ pr " rv.ret.%s.%s_val =" n n;
+ pr " safe_realloc (g, rv.ret.%s.%s_val,\n" n n;
+ pr " sizeof (char *) * (rv.ret.%s.%s_len + 1));\n"
+ n n;
pr " rv.ret.%s.%s_val[rv.ret.%s.%s_len] = NULL;\n" n n n n;
pr " return rv.ret.%s.%s_val;\n" n n
| RPVList n ->
}
/* caller will free this, but we need to add a NULL entry */
- rv.ret.listing.listing_val = safe_realloc (g, rv.ret.listing.listing_val, rv.ret.listing.listing_len + 1);
+ rv.ret.listing.listing_val = safe_realloc (g, rv.ret.listing.listing_val,
+ sizeof (char *) * (rv.ret.listing.listing_len + 1));
rv.ret.listing.listing_val[rv.ret.listing.listing_len] = NULL;
return rv.ret.listing.listing_val;
}
}
/* caller will free this, but we need to add a NULL entry */
- rv.ret.devices.devices_val = safe_realloc (g, rv.ret.devices.devices_val, rv.ret.devices.devices_len + 1);
+ rv.ret.devices.devices_val = safe_realloc (g, rv.ret.devices.devices_val,
+ sizeof (char *) * (rv.ret.devices.devices_len + 1));
rv.ret.devices.devices_val[rv.ret.devices.devices_len] = NULL;
return rv.ret.devices.devices_val;
}
}
/* caller will free this, but we need to add a NULL entry */
- rv.ret.partitions.partitions_val = safe_realloc (g, rv.ret.partitions.partitions_val, rv.ret.partitions.partitions_len + 1);
+ rv.ret.partitions.partitions_val = safe_realloc (g, rv.ret.partitions.partitions_val,
+ sizeof (char *) * (rv.ret.partitions.partitions_len + 1));
rv.ret.partitions.partitions_val[rv.ret.partitions.partitions_len] = NULL;
return rv.ret.partitions.partitions_val;
}
}
/* caller will free this, but we need to add a NULL entry */
- rv.ret.physvols.physvols_val = safe_realloc (g, rv.ret.physvols.physvols_val, rv.ret.physvols.physvols_len + 1);
+ rv.ret.physvols.physvols_val = safe_realloc (g, rv.ret.physvols.physvols_val,
+ sizeof (char *) * (rv.ret.physvols.physvols_len + 1));
rv.ret.physvols.physvols_val[rv.ret.physvols.physvols_len] = NULL;
return rv.ret.physvols.physvols_val;
}
}
/* caller will free this, but we need to add a NULL entry */
- rv.ret.volgroups.volgroups_val = safe_realloc (g, rv.ret.volgroups.volgroups_val, rv.ret.volgroups.volgroups_len + 1);
+ rv.ret.volgroups.volgroups_val = safe_realloc (g, rv.ret.volgroups.volgroups_val,
+ sizeof (char *) * (rv.ret.volgroups.volgroups_len + 1));
rv.ret.volgroups.volgroups_val[rv.ret.volgroups.volgroups_len] = NULL;
return rv.ret.volgroups.volgroups_val;
}
}
/* caller will free this, but we need to add a NULL entry */
- rv.ret.logvols.logvols_val = safe_realloc (g, rv.ret.logvols.logvols_val, rv.ret.logvols.logvols_len + 1);
+ rv.ret.logvols.logvols_val = safe_realloc (g, rv.ret.logvols.logvols_val,
+ sizeof (char *) * (rv.ret.logvols.logvols_len + 1));
rv.ret.logvols.logvols_val[rv.ret.logvols.logvols_len] = NULL;
return rv.ret.logvols.logvols_val;
}