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