Re: fopen_s



mike7411@xxxxxxxxx wrote:
How is fopen_s safer than fopen?

Googling for fopen_s brings

http://msdn2.microsoft.com/en-us/library/z5hh6ee9.aspx

which directs us to go to

http://msdn2.microsoft.com/en-us/library/8ef0s5kh.aspx

to find about "Security Enhancements in the CRT ". This page has the
following

<quote>
Enhanced error reporting. The secure functions return error codes with more
error information than was available with the preexisting functions. The
secure functions and many of the preexisting functions now set errno and
often return an errno code type as well, to provide better error reporting.
</quote>

How returning errno helps with error reporting and what this has to do with
security as such is beyond my imagination. Presumably somebody at Microsoft
has trouble understanding and using an API that doesn't uniformly return
error codes in COM manner.

--
Eugene
http://www.gershnik.com


.


Loading