HAve you tried printing c when it is read from the file and record after adding the terminating '\0' ?