🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3287

Re: C things

#3287
From: Lars Wirzenius
Date: Sat, 23 Jan 1993 14:54
15 lines
1112 bytes
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.
Technical Details
Message-ID: <1993Jan23.145449.9830@klaava.Helsinki.FI>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
References: <107937@bu.edu> <151@mccoy.dbaccess.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!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