From owner-cvs-lib Wed Oct 4 15:46:27 1995 Return-Path: owner-cvs-lib Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA07360 for cvs-lib-outgoing; Wed, 4 Oct 1995 15:46:27 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA07315 ; Wed, 4 Oct 1995 15:45:49 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id XAA02264; Wed, 4 Oct 1995 23:43:37 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id XAA00942; Wed, 4 Oct 1995 23:43:36 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.6.12/8.6.9) id XAA04988; Wed, 4 Oct 1995 23:41:17 +0100 From: J Wunsch Message-Id: <199510042241.XAA04988@uriah.heep.sax.de> Subject: Re: cvs commit: src/lib/libc/stdio gets.c To: nate@rocky.sri.MT.net (Nate Williams) Date: Wed, 4 Oct 1995 23:41:17 +0100 (MET) Cc: peter@freefall.freebsd.org, CVS-commiters@freefall.freebsd.org, cvs-lib@freefall.freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199510041853.MAA04484@rocky.sri.MT.net> from "Nate Williams" at Oct 4, 95 12:53:54 pm X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 694 Sender: owner-cvs-lib@FreeBSD.org Precedence: bulk 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; } -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)