diff options
author | Christian Rößler | 2017-10-06 17:46:13 +0200 |
---|---|---|
committer | Christian Rößler | 2017-10-06 17:46:13 +0200 |
commit | d5b34eaec816404a0fee58ef862c7efa81e2df9a (patch) | |
tree | 3288f814f7ebd1dc499885e2d8d028ec1b528725 /core/modules/run-virt/data/opt/openslx/vmchooser/data/linux | |
parent | [run-virt] network shares in shares.dat (diff) | |
download | mltk-d5b34eaec816404a0fee58ef862c7efa81e2df9a.tar.gz mltk-d5b34eaec816404a0fee58ef862c7efa81e2df9a.tar.xz mltk-d5b34eaec816404a0fee58ef862c7efa81e2df9a.zip |
[run-virt] Linux script: Bug in xor function
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/data/linux')
-rw-r--r-- | core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc index e3c22bb0..3152b85d 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/data/linux/includes/10_functions.inc @@ -6,11 +6,9 @@ function xor() while [[ "$1" ]]; do local ONE=($(echo "$1" | sed "s/../0x& /g")) local COUNT1=${#RES[@]} - if [ $COUNT1 -lt ${#ONE[@]} ]; then - COUNT1=${#ONE[@]} - fi + local COUNT2=${#ONE[@]} for (( i = 0; i < $COUNT1; i++ )); do - RES[$i]=$((${ONE[$i]:-0} ^ ${RES[$i]:-0})) + RES[$i]=$((${ONE[$(( i % COUNT2 ))]:-0} ^ ${RES[$i]:-0})) done shift 1 done |