*BSD News Article 18903


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!menudo.uh.edu!uuneo!sugar!peter
From: peter@NeoSoft.com (Peter da Silva)
Subject: Re: Using gets() [ Was Re: nn ]
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Mon, 26 Jul 1993 19:41:40 GMT
Message-ID: <CAsEpH.55o@sugar.NeoSoft.COM>
References: <CAKu2r.10rt@austin.ibm.com> <CAq222.8E4@sugar.NeoSoft.COM> <22u6tmINN2t6@xs4all.hacktic.nl>
Lines: 26

In article <22u6tmINN2t6@xs4all.hacktic.nl> cor@hacktic.nl (Cor) writes:
> peter@NeoSoft.com (Peter da Silva) writes:
> >I agree. gets should work as documented, but it should probably be stuck
> >in an "obsolete" library, to be linked in as "-lobso" for programs that
> >use broken functions. Stick strtok in there as well :>.

> Phew, at least *some* people that agree with my original posting.

Not entirely. I think gets() should be made non-functional unless you
make an explicit choice to pull it in. I just think that this breakage
should occur at compile time, not run time.

Having something like this in stdio.h would work too:

#ifdef I_ACCEPT_THE_RISK_OF_GETS
#define gets __real_gets__
#else
#define gets 'Please do not use gets, it is badly broken'
#endif

:->
-- 
Peter da Silva.  <peter@sugar.neosoft.com>.
 `-_-'   Hefur thu fadhmadh ulfinn i dag?
  'U`    
"Det er min ledsager, det er ikke drikkepenge."