Fixed EOF error by allocating for extra null byte