Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Buffered stderr on Linux



On Mar 12,  8:03pm, Zoltan Hidvegi wrote:
} Subject: Buffered stderr on Linux
}
} Now I wander why is it
} necessary to use malloc to allocate these buffers.  Is there anything
} against using static char[BUFSIZ] buffers?

Stdio will call free() on the buffer at fclose().  That means you should
always pass malloc'd buffers, and never call free() yourself on a buffer
that's been passed to any of the setbuf() variants!

-- 
Bart Schaefer
http://www.well.com/user/barts



Messages sorted by: Reverse Date, Date, Thread, Author