mirror of
https://github.com/opnsense/src.git
synced 2026-02-15 16:48:36 -05:00
Currently, there can be no more than INT_MAX positional parameters. Make sure to treat all higher ones as unset to avoid incorrect results and crashes. On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and sign-extends them. On 32-bit systems, the call to atoi() returned INT_MAX for too high values and there is not enough address space for so many positional parameters, so there was no issue.
14 lines
184 B
Text
14 lines
184 B
Text
# $FreeBSD$
|
|
|
|
i=1
|
|
r=0
|
|
while [ $i -lt $((0x100000000)) ]; do
|
|
t=
|
|
eval t=\${$i-x}
|
|
case $t in
|
|
x) ;;
|
|
*) echo "Problem with \${$i}" >&2; r=1 ;;
|
|
esac
|
|
i=$((i + 0x10000000))
|
|
done
|
|
exit $r
|