[Pkg-wmaker-commits] [wmgtemp] 04/10: wmgtemp: Fix -Waggressive-loop-optimizations compiler warning.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Feb 2 14:18:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository wmgtemp.

commit 0aa441b2709f65b086b3dd99bbfc7c3af8c8cc75
Author: Doug Torrance <dtorrance at piedmont.edu>
Date:   Wed Feb 1 21:51:58 2017 -0500

    wmgtemp: Fix -Waggressive-loop-optimizations compiler warning.
    
    In particular, the cpu_history array has length 59, so when i = 58,
    cpu_history[i+1] is undefined.
    
    From
    http://sources.debian.net/src/wmgtemp/1.1-3/debian/patches/fix_-Waggressive-loop-optimizations.patch/
---
 src/wmgtemp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wmgtemp.c b/src/wmgtemp.c
index 02d75a5..f4418a6 100644
--- a/src/wmgtemp.c
+++ b/src/wmgtemp.c
@@ -428,7 +428,7 @@ void update_sensor_data() {
   double sys_high = highest_temp(sys_history);
 
   /* Shift the arrays */
-  for(i = 0; i < 59; i++) {
+  for(i = 0; i < 58; i++) {
     cpu_history[i] = cpu_history[i + 1];
     sys_history[i] = sys_history[i + 1];
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmgtemp.git



More information about the Pkg-wmaker-commits mailing list