diff options
author | Ewgenij Starostin <ewgenij@ewgenij-starostin.name> | 2012-05-04 05:34:13 +0200 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2012-05-04 12:29:02 +0200 |
commit | b5f89c83cc47ed4cfdaf0e61748229a14e2b5e3d (patch) | |
tree | 7f6622f6e549a613370c0d69648a3ddd35639578 /src/print_cpu_temperature.c | |
parent | 7dc10f4205fd4f11626899048a7d627e56dfd59e (diff) |
Handle %d with non-default CPU temperature path.
Diffstat (limited to 'src/print_cpu_temperature.c')
-rw-r--r-- | src/print_cpu_temperature.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/print_cpu_temperature.c b/src/print_cpu_temperature.c index 41c3c9c..742a102 100644 --- a/src/print_cpu_temperature.c +++ b/src/print_cpu_temperature.c @@ -38,10 +38,11 @@ void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const char *outwalk = buffer; static char buf[16]; - if (path == NULL) { + if (path == NULL) asprintf(&thermal_zone, THERMAL_ZONE, zone); - path = thermal_zone; - } + else + asprintf(&thermal_zone, path, zone); + path = thermal_zone; INSTANCE(path); |