The current implementation had a problem anyways and did not work correctly.
ldd "$(command -v grep)" would return the following on Ubuntu:
ldd: ./alias grep='grep --color=auto': No such file or directory
This change fixes the problem and the current libc.so should be reliably found without any searching now.
As mentioned in https://github.com/slimm609/checksec.sh/pull/238#issuecomment-2079000854 it is actually better to not use ldd. @teoberi Thanks for bringing this up.
The current implementation had a problem anyways and did not work correctly.
ldd "$(command -v grep)"
would return the following on Ubuntu:ldd: ./alias grep='grep --color=auto': No such file or directory
This change fixes the problem and the current libc.so should be reliably found without any searching now.