diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-04-27 19:28:49 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-04-27 19:28:49 +0200 |
commit | 4cd9f4d9071a672debd83b4cc1c5d57dc63b8549 (patch) | |
tree | 095c755ba2cc77198dfc85b45afd129b1e638d56 /plugin_i2c_sensors.c | |
parent | 18590c85ce8d68b155828a4aa400105812aeb75d (diff) | |
parent | 181cec4348da40331b3e8ab365732c025ec149b2 (diff) | |
download | lcd4linux-4cd9f4d9071a672debd83b4cc1c5d57dc63b8549.tar.gz |
New upstream snapshot
Diffstat (limited to 'plugin_i2c_sensors.c')
-rw-r--r-- | plugin_i2c_sensors.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugin_i2c_sensors.c b/plugin_i2c_sensors.c index e47f407..ce70e35 100644 --- a/plugin_i2c_sensors.c +++ b/plugin_i2c_sensors.c @@ -1,5 +1,5 @@ -/* $Id: plugin_i2c_sensors.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_i2c_sensors.c $ +/* $Id: plugin_i2c_sensors.c 1082 2010-01-17 14:40:03Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_i2c_sensors.c $ * * I2C sensors plugin * @@ -44,7 +44,7 @@ /* * Available tokens : # represents an int from 1 to 3 (or more) - * temp_input# -> temperature of sensor # (in °C) + * temp_input# -> temperature of sensor # (in ∞C) * temp_max# and temp_hyst# -> max and min of sensor # * in_input#, in_min# and in_max# -> voltages * fan_input# -> speed (in RPM) of fan # @@ -74,6 +74,7 @@ #include "cfg.h" #include "hash.h" #include "qprintf.h" +#include "evaluator.h" // if strndup() is not available #ifdef WITH_DMALLOC #include <dmalloc.h> @@ -188,7 +189,7 @@ static int parse_i2c_sensors_procfs(const char *key) return -1; } - running = strdupa(buffer); + running = strndup(buffer, sizeof(buffer)); while (1) { value = strsep(&running, delim); /* debug("%s pos %i -> %s", file, pos , value); */ @@ -202,6 +203,7 @@ static int parse_i2c_sensors_procfs(const char *key) pos++; } } + free(running); return 0; } @@ -296,7 +298,7 @@ static int configure_i2c_sensors(void) path_cfg = realloc(path_cfg, strlen(path_cfg) + 2); strcat(path_cfg, "/"); } - debug("using i2c sensors at %s (from %s)", path, cfg_source()); + debug("using i2c sensors at %s (from %s)", path_cfg, cfg_source()); path = realloc(path, strlen(path_cfg) + 1); strcpy(path, path_cfg); } |