analyze: use size_t for number of units

This commit is contained in:
Yu Watanabe 2018-08-06 15:35:57 +09:00
parent 7735d9397b
commit 97cec9ba5e
1 changed files with 4 additions and 4 deletions

View File

@ -387,11 +387,11 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(struct host_info*, free_host_info);
static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
int r, c = 0;
struct boot_times *boot_times = NULL;
_cleanup_(unit_times_freep) struct unit_times *unit_times = NULL;
size_t size = 0;
struct boot_times *boot_times = NULL;
size_t allocated = 0, c = 0;
UnitInfo u;
int r;
r = acquire_boot_times(bus, &boot_times);
if (r < 0)
@ -417,7 +417,7 @@ static int acquire_time_data(sd_bus *bus, struct unit_times **out) {
while ((r = bus_parse_unit_info(reply, &u)) > 0) {
struct unit_times *t;
if (!GREEDY_REALLOC(unit_times, size, c+2))
if (!GREEDY_REALLOC(unit_times, allocated, c+2))
return log_oom();
unit_times[c+1].has_data = false;