Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Oct 19, 2024
1 parent e26f12c commit 23248e6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,11 @@ get_version()
printf '%s\n' "${_version}"
}

get_max_unsigned_int_of_shell_printf()
{
printf '%u\n' '-1'
}

pause_if_needed()
{
# shellcheck disable=SC3028 # In POSIX sh, SHLVL is undefined
Expand Down Expand Up @@ -903,10 +908,8 @@ main()
done
_shell_arithmetic_bit="$(convert_max_signed_int_to_bit "${_max}")" || _shell_arithmetic_bit='unknown'

{
# Some shells do NOT allow this, so we hide the errors
tmp_var="$(printf '%u\n' '-1' || :)"
} 2> /dev/null
# Some shells do NOT allow this, so we hide the errors
tmp_var="$(get_max_unsigned_int_of_shell_printf 2> /dev/null || :)"
_shell_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}" || :)"

tmp_var="$(awk -- 'BEGIN { printf "%u\n", "-1" }' || :)"
Expand Down

0 comments on commit 23248e6

Please sign in to comment.