diff options
author | DX37 | 2020-09-05 12:47:54 +0700 |
---|---|---|
committer | DX37 | 2020-09-05 12:47:54 +0700 |
commit | 78260f9863fb90ca1efe9f8878738b2fa535e8b1 (patch) | |
tree | 723df774ca083f066f495e1b3b9e6640ad97806e /htop-temperature-rpi.patch | |
parent | 46fd0e2d971b4eb4634371009214826cc0980136 (diff) | |
download | aur-78260f9863fb90ca1efe9f8878738b2fa535e8b1.tar.gz |
fixes
- apply some fixes to temperature patch
- add myself as contributor
Diffstat (limited to 'htop-temperature-rpi.patch')
-rw-r--r-- | htop-temperature-rpi.patch | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/htop-temperature-rpi.patch b/htop-temperature-rpi.patch index 80f4be1025b7..f1660edb952e 100644 --- a/htop-temperature-rpi.patch +++ b/htop-temperature-rpi.patch @@ -112,11 +112,12 @@ new file mode 100644 index 0000000..18b198d --- /dev/null +++ b/TemperatureMeter.c -@@ -0,0 +1,87 @@ +@@ -0,0 +1,88 @@ +/* +htop - TemperatureMeter.c +(C) 2013 Ralf Stemmer +(C) 2014 Blair Bonnett ++(C) 2020 Maxim Kurnosenko +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ @@ -162,7 +163,7 @@ index 0000000..18b198d + int read; + size_t len; + char *line = NULL; -+ int temperature; ++ long temperature; + while ((read = getline(&line, &len, p)) != -1) { + // convert the string into an integer, this is necessary for further steps + temperature = strtol(line, NULL, 10); @@ -171,13 +172,13 @@ index 0000000..18b198d + + // choose the color for the temperature + int tempColor; -+ if (temperature < 60) tempColor = coolColor; -+ else if (temperature >= 60 && temperature < 70) tempColor = mediumColor; -+ else tempColor = hotColor; ++ if (temperature < 60) tempColor = coolColor; ++ else if (temperature < 70) tempColor = mediumColor; ++ else tempColor = hotColor; + + // output the temperature -+ char buffer[20]; -+ sprintf(buffer, "%d", temperature); ++ char buffer[30]; ++ sprintf(buffer, "%ld", temperature); + RichString_append(out, tempColor, buffer); + RichString_append(out, textColor, "°C "); + } @@ -205,7 +206,7 @@ new file mode 100644 index 0000000..b86ddd8 --- /dev/null +++ b/TemperatureMeter.h -@@ -0,0 +1,19 @@ +@@ -0,0 +1,20 @@ +/* Do not edit this file. It was automatically generated. */ + +#ifndef HEADER_TemperatureMeter @@ -214,6 +215,7 @@ index 0000000..b86ddd8 +htop - TemperatureMeter.h +(C) 2013 Ralf Stemmer +(C) 2014 Blair Bonnett ++(C) 2020 Maxim Kurnosenko +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ |