zero-terminate the results from read() for backward compatibility