Subject: RE: Is fclose(NULL) defined?
To: current-users <current-users@NetBSD.ORG>
From: John Maier <JohnAM@datastorm.com>
List: current-users
Date: 09/12/1995 08:59:00
>Could someone please tell what the expected result of fclose() on a
>null-pointer should be.  On NetBSD-current/i386 I get a segmentation
>fault.  Is it just bad programming practice to not check whether a
>file pointer is NULL before it is passed to fclose()?  I notice that
>on DEC/OSF, DEC/Ultrix, and HP-UX it seems to be OK to invoke fclose()
>with a NULL poiner.

I believe the ANSI C spec requires some sort of handling for NULL pointers 
(in all situations?), I don't what it is for fclose off the top of my head. 
 I'll have to look it up at home.

jam