mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 12:09:55 +00:00
Merge pull request #255 from gabe565/patch-1
Image directory randomization can go out of bounds
This commit is contained in:
2
neofetch
2
neofetch
@@ -2158,7 +2158,7 @@ getimage () {
|
|||||||
*)
|
*)
|
||||||
if [ "${image: -1}" == "/" ]; then
|
if [ "${image: -1}" == "/" ]; then
|
||||||
files=("$image"*.png "$image"*.jpg)
|
files=("$image"*.png "$image"*.jpg)
|
||||||
img="$(printf "%s" "${files[RANDOM % ${#files[@]}]}")"
|
img="$(printf "%s" "${files[RANDOM % (${#files[@]} - 1)]}")"
|
||||||
else
|
else
|
||||||
img="$image"
|
img="$image"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user