Skip to content

Commit

Permalink
fix(install.sh):fix arr out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
likzn committed May 3, 2022
1 parent b759ef6 commit 7027320
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ function vercomp() {
then
max_len=$len2
fi

#pad right in short arr
if [[ len1 -gt len2 ]];
then
for ((i = len2; i < len1; i++));
do
v2[$i]=0
done
else
for ((i = len1; i < len2; i++));
do
v1[$i]=0
done
fi

for i in `seq 0 $max_len`
do
# Fill empty fields with zeros in v1
Expand Down

0 comments on commit 7027320

Please sign in to comment.