From 9d96a82c807149c7077baa546e18e9dadb7e7c37 Mon Sep 17 00:00:00 2001 From: Octavian Damiean Date: Sun, 30 Jun 2013 22:04:00 +0200 Subject: [PATCH] Added null check for count in _lp_temp_sensors() to stop division by zero errors in case count is still zero. --- liquidprompt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/liquidprompt b/liquidprompt index 9cc75a7..6be218d 100755 --- a/liquidprompt +++ b/liquidprompt @@ -1200,6 +1200,9 @@ _lp_temp_sensors() { temperature=$(($temperature+$i)) count=$(($count+1)) done + if test $count -eq 0; then + exit + fi echo -ne "$(($temperature/$count))" }