Cesar Rodas wrote:
while ( (n=fread(buff,Buffsize,1,file)) > 0)
{
if (i>0)
*value = realloc(*value, (i+1) * Buffsize);
memcpy(*value + (i * Buffsize), buff, Buffsize);
*len += n;
i++;
}
An afterthought, why don't you just stat the file and malloc the right
sized buffer from the outset? Much easier.
Martin
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------