Mark the end of read bytes with 0.

Code taken from the speccy.pl forum.