Subject: Is fclose(NULL) defined?
To: None <current-users@NetBSD.ORG>
From: Arne Helme <arne@pegasus.esprit.ec.org>
List: current-users
Date: 09/11/1995 22:09:13
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 always do an explicit test first, though...

Thanks,

-- Arne
| Arne Helme, http://www.pegasus.esprit.ec.org/people/arne/index.html  |
|  Inf/SPA, Univ. of Twente, Box 217, 7500 AE Enschede, Netherlands    |
|    PHONE: +31-53-894178, FAX: +31-53-333895, HOME: +31-53-326377     |
| arne@acm.org, arne@pegasus.esprit.ec.org,  "Die Stille ist Abstrakt" |