tools: Fix overflow of the donation progress bar.
authorWerner Koch <wk@gnupg.org>
Thu, 5 Feb 2015 23:24:25 +0000 (00:24 +0100)
committerWerner Koch <wk@gnupg.org>
Thu, 5 Feb 2015 23:24:25 +0000 (00:24 +0100)
tools/mkkudos.sh

index 3dbcab8..6d7e32b 100755 (executable)
@@ -87,8 +87,9 @@ goal="120000"
 tmp=$(grep '^2014:12:' "$donations")
 euro=$(echo "$tmp" | awk -F: '{printf "%d", int($8 + 0.5)}')
 euro=$(($euro + $euroyr_campaign))
-percent=$(echo "$euro:$goal" | awk -F: '{printf "%d",(int($1)*100)/int($2)}')
-
+percent=$(echo "$euro:$goal" | awk -F: '{ p = (int($1)*100)/int($2);
+                                          if(p > 100) { p = 100 };
+                                          printf "%d", p}')
 
 for file in "$htdocs/donate/"kudos-????.html "$htdocs/donate/"kudos.html \
             "$htdocs/donate/"index.html \