F
Flash Gordon
Keith Thompson wrote, On 19/10/07 07:29:
If the first fopen fails sf will be a null pointer and short circuit
evaluation ensures that df is not accessed, so it is OK.
Agreed.
If the first fopen() fails, no value is assigned to df, and accessing
it invokes undefined behavior.
If the first fopen fails sf will be a null pointer and short circuit
evaluation ensures that df is not accessed, so it is OK.
In addition, I think you're write; though fclose() cannot change the
value of of its argument, it can cause it to become indeterminate.
(In practice, it will probably appear to be be null or non-null after
fclose() if it was, respectively, null or non-null before fclose().)
Agreed.