🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #250

Re: Safe coding practices

#250
From: Doug Gwyn
Date: Fri, 25 Jan 1991 16:53
9 lines
1022 bytes
In article <22311:Jan2502:34:1191@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>... there's no safe way to use realloc() ...

In Standard C realloc() is required to be safe.  Of course it may return
NULL even if you're attempting to shrink the allocation, although it is
unlikely that an implementation would be so deficient.

The relevant point is that one should be prepared to deal with realloc()
failure, not blindly assume it will always work.
Technical Details
Message-ID: <14970@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!rpi!uupsi!cmcl2!adm!smoke!gwyn
References: <1991Jan24.060707.22566@tkou02.enet.dec.com> <22870@well.sf.ca.us> <22311:Jan2502:34:1191@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!rpi!uupsi!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.bugs.4bsd,comp.std.c,comp.lang.c
Subject: Re: Safe coding practices
Message-ID: <14970@smoke.brl.mil>
Date: 25 Jan 91 16:53:57 GMT
References: <1991Jan24.060707.22566@tkou02.enet.dec.com> <22870@well.sf.ca.us> <22311:Jan2502:34:1191@kramden.acf.nyu.edu>
Followup-To: comp.bugs.4bsd
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 9