home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / c / 3403 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.1 KB  |  26 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
  3. From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
  4. Subject: Re: C things
  5. Message-ID: <1993Jan23.145449.9830@klaava.Helsinki.FI>
  6. Organization: University of Helsinki
  7. References: <107937@bu.edu> <151@mccoy.dbaccess.com>
  8. Date: Sat, 23 Jan 1993 14:54:49 GMT
  9. Lines: 15
  10.  
  11. steve@dbaccess.com (Steve Suttles) writes:
  12. >The problem is that with gets and strcat and several other routines,
  13. >you pass the address of a destination array and it fills it up.
  14.  
  15. While strcat (and strcpy, sprintf, etc) doesn't have way to specify
  16. the size of the target memory area, it is very, very different from
  17. gets in that the programmer still can check the size in advance and
  18. avoid problems in that way.  This advance checking is impossible with
  19. the gets interface.  Hence, gets is inherently dangerous, strcat only
  20. if you make a mistake when you use it (easy enough).  An important
  21. distinction, IMHO.
  22.  
  23. --
  24. Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
  25.    MS-DOS, you can't live with it, you can live without it.
  26.