Use signed variable to check available buffer size.