strnlen sub for count