From owner-freebsd-questions Mon Oct 2 11:49:43 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA14748 for questions-outgoing; Mon, 2 Oct 1995 11:49:43 -0700 Received: from chemserv.umd.edu (chemserv.umd.edu [129.2.64.40]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA14736 for ; Mon, 2 Oct 1995 11:49:35 -0700 Received: from latte.eng.umd.edu (latte.eng.umd.edu [129.2.98.15]) by chemserv.umd.edu (8.7/8.7) with ESMTP id OAA00860; Mon, 2 Oct 1995 14:49:10 -0400 (EDT) Received: (chuckr@localhost) by latte.eng.umd.edu (8.7/8.6.4) id OAA12191; Mon, 2 Oct 1995 14:49:30 -0400 (EDT) Date: Mon, 2 Oct 1995 14:49:30 -0400 (EDT) From: Chuck Robey To: olsenc@ichips.intel.com cc: questions@freebsd.org Subject: Re: If not gets(), then what? In-Reply-To: <9510021814.AA35311@dtt034.intel.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk On Mon, 2 Oct 1995 olsenc@ichips.intel.com wrote: > Hello: > > I have a program that uses gets(), and FreeBSD complains about it. > I read the manpage on gets(), and it says it's dangerous, but yet > it doesn't mention any alternatives! > > Suggestions, recommendations, testimonials, confessions? fgets can do the job of gets, with the extra bargain of removing worry over a user overrunning your buffer space, because of the *size* veriable in fgets. Beware of the difference in the handling of newlines, fgets does it differently than gets. Look at the manpage. > > Btw, FreeBSD 2.0.5 RELEASE is rock solid. Very nice job, you guys! > It was nice to finally get rid of Linux. > > Thanks, > > -Clint > ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@eng.umd.edu | communications topic, C programming, and Unix. 9120 Edmonston Ct #302 | Greenbelt, MD 20770 | I run Journey2 and n3lxx, both FreeBSD (301) 220-2114 | version 2.2 current -- and great FUN! ----------------------------+-----------------------------------------------