getting a warning about gets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CBFalconer

    #16
    Re: getting a warning about gets

    pereges wrote:
    >
    I'm getting a warning on my linux gcc compiler:
    >
    /tmp/ccXgHa9s.o(.tex t+0x48): In function `main':
    : warning: the `gets' function is dangerous and should not be used.
    And you should pay attention and not use it. The simplest
    replacement is ggets, which is written in standard C and you can
    simply compile and link it to your program. See:

    <http://cbfalconer.home .att.net/download/ggets.zip>

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home .att.net>
    Try the download section.


    ** Posted from http://www.teranews.com **

    Comment

    • Peter Nilsson

      #17
      Re: getting a warning about gets

      Barry Schwarz wrote:
      pereges <Brol...@gmail. comwrote:
      Will this suffice:

      if(scanf("%s", zf_name) != 1)
      >
      As coded, this is no better than fgets. ...
      YM gets().

      --
      Peter

      Comment

      Working...