So i have this function that reads file, allocates memory, and puts file\'s content into buffer. I constantly get garbage data in the end though, so i need a way to null ter