From owner-freebsd-commit Wed Oct 4 16:34:39 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA08572 for freebsd-commit-outgoing; Wed, 4 Oct 1995 16:34:39 -0700 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA08556 for cvs-all-outgoing; Wed, 4 Oct 1995 16:34:30 -0700 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA08502 for cvs-lib-outgoing; Wed, 4 Oct 1995 16:33:06 -0700 Received: from rocky.sri.MT.net (sri.MT.net [204.94.231.129]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id QAA08495 ; Wed, 4 Oct 1995 16:32:56 -0700 Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id RAA05253; Wed, 4 Oct 1995 17:29:57 -0600 Date: Wed, 4 Oct 1995 17:29:57 -0600 From: Nate Williams Message-Id: <199510042329.RAA05253@rocky.sri.MT.net> To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Cc: nate@rocky.sri.MT.net (Nate Williams), peter@freefall.freebsd.org, CVS-commiters@freefall.freebsd.org, cvs-lib@freefall.freebsd.org Subject: Re: cvs commit: src/lib/libc/stdio gets.c In-Reply-To: <199510042241.XAA04988@uriah.heep.sax.de> References: <199510041853.MAA04484@rocky.sri.MT.net> <199510042241.XAA04988@uriah.heep.sax.de> Sender: owner-commit@FreeBSD.org Precedence: bulk J. Wunsch writes: > As Nate Williams wrote: > > > > ... If you also want to take some more > > inspiration from NetBSD, add a static variable to the sources so the > > warning is printed at run-time only once. It is still annoying, but not > > continually annoying. > > huh? This has been there all the time: > > static int warned; > static char w[] = > "warning: this program uses gets(), which is unsafe.\r\n"; > > if (!warned) { > (void) write(STDERR_FILENO, w, sizeof(w) - 1); > warned = 1; > } > Whoops. Colod me red-faced. I'll go back and slink into my corner. Nate