Re: style question,itoa
- From: Syren Baran <sbaran@xxxxxxxxxxxxxxx>
- Date: Wed, 23 Jan 2008 19:42:20 +0100
Robert Latest schrieb:
Syren Baran wrote:Not really. I dont like using arrays on the stack unless i can know for certain they cant overflow. But thats my personal style.David Schwartz schrieb:
That's puzzling.The caller has to 'free' 'retval' when it's done.Its intended that way.It might be moreDont intend to change that. I´m comfortable with that.
sensible to have the caller pass in a buffer. This will allow the
caller to use a buffer on its stack if that makes the most sense for
it.
But you still need to add code that checks for malloc()s retun value.Theoreticly, yes.
Since the program i´ll use it cant eat up memory at an alarming rate i prefer manual intervention (being able to tell the program not to accecpt further connections and deny further functions calls that can allocate memory).
Aside from that even a nun-NULL return value from malloc does not garantee that memory is available on Linux (see man 3 malloc).
.
robert
- Follow-Ups:
- Re: style question,itoa
- From: Rainer Weikusat
- Re: style question,itoa
- From: Spoon
- Re: style question,itoa
- From: Frank Cusack
- Re: style question,itoa
- References:
- style question,itoa
- From: Syren Baran
- Re: style question,itoa
- From: David Schwartz
- Re: style question,itoa
- From: Syren Baran
- Re: style question,itoa
- From: Robert Latest
- style question,itoa
- Prev by Date: Re: base64-ed validvote tarball
- Next by Date: Re: style question,itoa
- Previous by thread: Re: style question,itoa
- Next by thread: Re: style question,itoa
- Index(es):
Relevant Pages
|