1-off error

For some reason on one machine the buffers included one '\0' before the end, therefore the size calculations were all wrong.