Fixed CD Functions

I was using a  MSVC++ scan function instead of the stdio one. Please
merge.