From f650263a946b9d7a0dca786948df448d32ef1f9b Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 1 Jun 2018 19:15:46 +0200 Subject: [PATCH] df plugin: fix implicit conversion warning CC src/df.lo src/df.c:231:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] len = strlen(disk_name); ~ ^~~~~~~~~~~~~~~~~ 1 warning generated. --- src/df.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/df.c b/src/df.c index e3aa4536..8877b740 100644 --- a/src/df.c +++ b/src/df.c @@ -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] = '-'; } -- 2.11.0