diff options
author | TingPing <tingping@tingping.se> | 2013-01-09 19:53:26 -0800 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2013-01-09 19:53:26 -0800 |
commit | ba2927e3c5e797160be7dee8d90b78d035b76c93 (patch) | |
tree | 13d1891e6507aa6d28fef5a407821aa141e554e0 /plugins/sysinfo/parse.c | |
parent | ed786843de94359a0f3dd9ccea1d3796c3a33d12 (diff) | |
parent | 672dbf75d6d3d47135be49568ebcce917d6c188c (diff) |
Merge pull request #368 from RichardHitt/pull360
Make source clean with cppcheck, except for mpc and sasl, closes #360
Diffstat (limited to 'plugins/sysinfo/parse.c')
-rw-r--r-- | plugins/sysinfo/parse.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/sysinfo/parse.c b/plugins/sysinfo/parse.c index fbca6213..c1b478f8 100644 --- a/plugins/sysinfo/parse.c +++ b/plugins/sysinfo/parse.c @@ -394,6 +394,7 @@ int xs_parse_distro(char *name) char keywords[bsize]; while(fgets(buffer, bsize, fp) != NULL) find_match_char(buffer, "ACCEPT_KEYWORDS", keywords); + /* cppcheck-suppress uninitvar */ if (strstr(keywords, "\"") == NULL) snprintf(buffer, bsize, "Gentoo Linux (stable)"); else @@ -440,16 +441,14 @@ int xs_parse_hwmon_chip(char *chip) int xs_parse_hwmon_temp(char *temp, unsigned int *sensor) { - unsigned int *value; + unsigned int value; float celsius; - value = malloc(sizeof(int)); if (!hwmon_chip_present()) return 1; else - get_hwmon_temp(value, sensor); - celsius = (float)*value; + get_hwmon_temp(&value, sensor); + celsius = (float)value; snprintf(temp, bsize, "%.1fC", celsius/1000.0); - free(value); return 0; } |