cURL / Mailing Lists / curl-library / Single Mail


Re: Modifying the example source code

From: Ben Noordhuis <>
Date: Mon, 28 Feb 2011 23:13:57 +0100

On Mon, Feb 28, 2011 at 09:34, Tor Arntsen <> wrote:
> Just to pre-answer a question people may ask.. realloc(NULL) works
> fine on many architectures. But not on all architectures. To be
> perfectly portable we use the malloc(1) trick.

Tor, do you happen to know on what platforms or architectures
realloc(NULL) causes issues? ISO mandates that it should be
functionally equivalent to malloc() and I use it like that in my own
code. It's never blown up so far but if there are portability issues,
I'd like to be one step ahead of them.
List admin:
Received on 2011-02-28