From f83d78dd2801c7e4bee406379d3119f8852cf297 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 19 Jul 2014 13:36:13 +1000 Subject: Warning cleanup - ignoring const - declarations after statements - some C files didnt include own headers (risking them getting out of sync) Closes #1064 --- plugins/sysinfo/hwmon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/sysinfo/hwmon.c') diff --git a/plugins/sysinfo/hwmon.c b/plugins/sysinfo/hwmon.c index 389244ac..e562458f 100644 --- a/plugins/sysinfo/hwmon.c +++ b/plugins/sysinfo/hwmon.c @@ -53,8 +53,9 @@ void get_hwmon_chip_name(char *name) void get_hwmon_temp(unsigned int *value, unsigned int *sensor) { char buffer[bsize]; + FILE *fp; snprintf(buffer, bsize, "/sys/class/hwmon/hwmon0/device/temp%i_input", *sensor); - FILE *fp = fopen(buffer, "r"); + fp = fopen(buffer, "r"); if(fp != NULL) { if(fgets(buffer, bsize, fp) != NULL) *value = atoi(buffer); -- cgit 1.4.1