Fixed typo $length > $bufLength