don't store garbage at the end of the buffer