X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdf.c;h=8877b74092a59495fc49d093621edf2930625faf;hb=74ee9a04ef5785b31d1acbfdcbcece3370668cfe;hp=3cade6a2318c8ff224e75f9205be2580b03b1249;hpb=7b0628b4f4688d48d89f94ca381ca6340da05b37;p=collectd.git diff --git a/src/df.c b/src/df.c index 3cade6a2..8877b740 100644 --- a/src/df.c +++ b/src/df.c @@ -51,9 +51,9 @@ static const char *config_keys[] = { "ReportByDevice", "ReportInodes", "ValuesAbsolute", "ValuesPercentage"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static ignorelist_t *il_device = NULL; -static ignorelist_t *il_mountpoint = NULL; -static ignorelist_t *il_fstype = NULL; +static ignorelist_t *il_device; +static ignorelist_t *il_mountpoint; +static ignorelist_t *il_fstype; static bool by_device; static bool report_inodes; @@ -225,12 +225,10 @@ static int df_read(void) { if (strcmp(mnt_ptr->dir, "/") == 0) sstrncpy(disk_name, "root", sizeof(disk_name)); else { - int len; - sstrncpy(disk_name, mnt_ptr->dir + 1, sizeof(disk_name)); - len = strlen(disk_name); + size_t len = strlen(disk_name); - for (int i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) if (disk_name[i] == '/') disk_name[i] = '-'; }