Date: Thu, 22 Oct 1998 08:26:07 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) Cc: Peter Wemm <peter@netplex.com.au>, Bruce Evans <bde@zeta.org.au>, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio mktemp.c Message-ID: <199810221526.IAA13589@apollo.backplane.com> References: <199810210245.KAA14596@spinner.netplex.com.au> <199810210437.VAA01979@apollo.backplane.com> <xzpvhleqo8u.fsf@grjottunagard.ifi.uio.no> <199810211608.JAA06244@apollo.backplane.com> <xzphfwxt2fp.fsf@hrotti.ifi.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
:Matthew Dillon <dillon@apollo.backplane.com> writes:
:
:I was referring to the argument about whether or not fclose() should
:dump core when passed a NULL pointer.
:
:DES
Let me throw one back at you: should one be able to call vprintf()
with NULL for the file or vsprintf() with NULL for the buffer and have
them return the number of characters they would have printed? That came
up five years ago while I was working on DICE (My 68000 C compiler).
There are a thousand little hacks people have done to standard library
routines in the past. Had I implemented those and other hacks, I would
never have been able to port my code from the Amiga to, say, FreeBSD,
without a hellofalot more work.
It is generally a real *bad* idea to implement any such hacks for
precisely that reason. Unless *everyone* imlements the same hack,
all that happens is that anyone writing code using the hack has to rip
it out again when they port the code to another platform. Implementing
these hacks does nobody any favors, believe me.
But things like vsprintf(NULL, ...) are very different form things
like mkstemp(). The mkstemp() discussion below is a security discussion.
vsprintf(NULL, ...), fclose(NULL), and others of that ilk are feature
enhancement hacks. The two are very different beasts and you just
can't compare one against the other as you appear to be doing.
-Matt
:--
:Dag-Erling Smørgrav - dag-erli@ifi.uio.no
:
:
Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet
Communications & God knows what else.
<dillon@backplane.com> (Please include original email in any response)
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810221526.IAA13589>
