diff options
author | Pim van den Berg | 2012-12-21 19:10:23 +0100 |
---|---|---|
committer | Pim van den Berg | 2012-12-21 19:10:23 +0100 |
commit | 47d1d2e9c0920d23d6e565e2003ad32894f4b9cb (patch) | |
tree | 42d53e5408514238f1ea44349db1e9a1b3d7b712 /type | |
parent | type: resolve undefined variable $c and $raw notices (diff) | |
download | apt-panopticon_cgp-47d1d2e9c0920d23d6e565e2003ad32894f4b9cb.zip apt-panopticon_cgp-47d1d2e9c0920d23d6e565e2003ad32894f4b9cb.tar.gz apt-panopticon_cgp-47d1d2e9c0920d23d6e565e2003ad32894f4b9cb.tar.bz2 apt-panopticon_cgp-47d1d2e9c0920d23d6e565e2003ad32894f4b9cb.tar.xz |
type/default: resolve division by zero warning
Reported-by: Philipp Hellmich <Philipp.Hellmich@Bertelsmann.de>
Diffstat (limited to 'type')
-rw-r--r-- | type/Default.class.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/type/Default.class.php b/type/Default.class.php index 26189c7..48852d4 100644 --- a/type/Default.class.php +++ b/type/Default.class.php | |||
@@ -39,7 +39,7 @@ class Type_Default { | |||
39 | $sources = count($this->rrd_get_sources()); | 39 | $sources = count($this->rrd_get_sources()); |
40 | foreach ($this->rrd_get_sources() as $ds) { | 40 | foreach ($this->rrd_get_sources() as $ds) { |
41 | # hue (saturnation=1, value=1) | 41 | # hue (saturnation=1, value=1) |
42 | $h = 360 - ($c * (330/($sources-1))); | 42 | $h = $sources > 1 ? 360 - ($c * (330/($sources-1))) : 360; |
43 | 43 | ||
44 | $h = ($h %= 360) / 60; | 44 | $h = ($h %= 360) / 60; |
45 | $f = $h - floor($h); | 45 | $f = $h - floor($h); |