rework get_length() and fix bug(s)
rework get_length() and fix bug(s)

akgood/yubico-piv-tool,hirden/yubico-piv-tool,Yubico/yubico-piv-tool,hirden/yubico-piv-tool,Yubico/yubico-piv-tool,Yubico/yubico-piv-tool,akgood/yubico-piv-tool,ato/yubico-piv-tool,akgood/yubico-piv-tool,akgood/yubico-piv-tool,ato/yubico-piv-tool