mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-22 05:27:01 +01:00
Fix div function to manage 0 on numerator (#79)
fix #77 Co-authored-by: GoldenKiwi <thibault.dewailly@corp.ovh.com>
This commit is contained in:
parent
c50f200c5c
commit
1c1393c7e3
@ -121,6 +121,10 @@ div() {
|
|||||||
local _d=${3:-2}
|
local _d=${3:-2}
|
||||||
local _n=0000000000
|
local _n=0000000000
|
||||||
_n=${_n:0:$_d}
|
_n=${_n:0:$_d}
|
||||||
|
if (($1 == 0)); then
|
||||||
|
echo "0"
|
||||||
|
return
|
||||||
|
fi
|
||||||
if (($2 == 0)); then
|
if (($2 == 0)); then
|
||||||
echo "N.A"
|
echo "N.A"
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user