From owner-cvs-all Thu Oct 22 08:26:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA10981 for cvs-all-outgoing; Thu, 22 Oct 1998 08:26:53 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA10975; Thu, 22 Oct 1998 08:26:43 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.1/8.9.1) id IAA13589; Thu, 22 Oct 1998 08:26:07 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Oct 1998 08:26:07 -0700 (PDT) From: Matthew Dillon Message-Id: <199810221526.IAA13589@apollo.backplane.com> To: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) Cc: Peter Wemm , Bruce Evans , cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio mktemp.c References: <199810210245.KAA14596@spinner.netplex.com.au> <199810210437.VAA01979@apollo.backplane.com> <199810211608.JAA06244@apollo.backplane.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk :Matthew Dillon 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. (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