Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 1998 05:56:29 +0200 (CEST)
From:      Matthias Buelow <mkb@altair.mayn.de>
To:        shmit@kublai.com
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/7742: fclose(3) dumps core on NULL
Message-ID:  <199809290356.FAA00440@altair.mayn.de>
In-Reply-To: <19980928182631.B307@kublai.com> from Brian Cully at "Sep 28, 1998  6:26:31 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Brian Cully wrote:

>Why is free(NULL) permissable, but not fclose(NULL)?

Because the behaviour of free(NULL) is explicitly defined by
ANSI/ISO C.

It might be questionable, though, whether fclose(NULL) should
really segfault or just report EOF like on other error conditions.
However, since many programmers probably don't check the return
value of fclose, the segfault perhaps gains more attention to the
buggy code.

 - mkb

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809290356.FAA00440>