Doh, use the buffer size. Thanks Eleriseth and Juiceman for pointing this out.