X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapple_sensors.c;h=48fbcb91e53117832fc26160df4f8ecd4fa96947;hb=448627953cde2f7b3b138f53f4f2c62f0d48b726;hp=7ed2016f2a3bee68fffd04c41d106fdf8034b143;hpb=ab11d1b4db61f750f51be6e41dbe8320d3c65404;p=collectd.git diff --git a/src/apple_sensors.c b/src/apple_sensors.c index 7ed2016f..48fbcb91 100644 --- a/src/apple_sensors.c +++ b/src/apple_sensors.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -113,8 +114,6 @@ static int as_read (void) char inst[128]; int value_int; double value_double; - int i; - if (!io_master_port || (io_master_port == MACH_PORT_NULL)) return (-1); @@ -169,7 +168,7 @@ static int as_read (void) kCFStringEncodingASCII)) continue; inst[sizeof (inst) - 1] = '\0'; - for (i = 0; i < 128; i++) + for (int i = 0; i < 128; i++) { if (inst[i] == '\0') break;