Subject: Re: Possible bug relating to malloc()/realloc(), popen(), and read()
To: Vincent Stemen <netbsd@crel.us>
From: Martin Husemann <martin@duskware.de>
List: port-i386
Date: 12/02/2004 15:25:35
On Wed, Dec 01, 2004 at 07:05:40PM -0600, Vincent Stemen wrote:
> but the pointer I get back from realloc() does
> not point to the beginning of the data allocated by the first malloc()
> as it should.

Why do you think it should?

Your program does not properly handle return values from read(). You need
to check -1 and errno == EAGAIN at least, if you don't read from straight
disk files.

Martin