Skip to content

Commit

Permalink
Minor corrections
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Dec 11, 2021
1 parent 6b7170c commit d5d0f37
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions easytls-tctip.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ verbose_easytls_tctip_lib ()
{
[ $EASYTLS_TCTIP_LIB_VERBOSE ] || return 0
"${EASYTLS_PRINTF}" '%s\n' "${1}"
}

} # => verbose_easytls_tctip_lib ()

# IPv4 address to decimal
ip2dec ()
Expand Down Expand Up @@ -203,8 +202,7 @@ validate_ip4_data ()

# Syntax
case "${temp_ip_addr}" in
*[!0123456789./]* | .* | *. | *..* )
return 11
*[!0123456789./]* | .* | *. | *..* | */*.* ) return 11 ;;
esac

# Netmask
Expand All @@ -215,7 +213,7 @@ validate_ip4_data ()
else
temp_ip_addr="${temp_ip_addr%/*}"
[ -z "${mask_len}" ] && return 12
[ ] &&
[ -z "${mask_len%%0*}" ] && return 12
if [ "${mask_len}" -lt 0 ] || [ "${mask_len}" -gt 32 ]
then
return 13
Expand Down Expand Up @@ -301,7 +299,7 @@ validate_ip6_data ()

[ -z "${mask_len}" ] && return 12
case "${mask_len}" in
*[!0123456789]* ) return 11 ;;
*[!0123456789]* | 0* ) return 11 ;;
esac
if [ "${mask_len}" -lt 0 ] || [ "${mask_len}" -gt 128 ]
then
Expand Down

1 comment on commit d5d0f37

@TinCanTech
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.