Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 1995 23:41:17 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        nate@rocky.sri.MT.net (Nate Williams)
Cc:        peter@freefall.freebsd.org, CVS-commiters@freefall.freebsd.org, cvs-lib@freefall.freebsd.org
Subject:   Re: cvs commit: src/lib/libc/stdio gets.c
Message-ID:  <199510042241.XAA04988@uriah.heep.sax.de>
In-Reply-To: <199510041853.MAA04484@rocky.sri.MT.net> from "Nate Williams" at Oct 4, 95 12:53:54 pm

next in thread | previous in thread | raw e-mail | index | archive | help
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. ;-)



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