You haven't posted enough info to post a definite answer, but here's my educated guess:
C strings are null terminated. If you read only a partial string and don't terminate it, but try to print it as a C string, you'll get undefined behaviour - in practice, you'll see the garbage following it.