[comp.bugs.sys5] bug in setvbuf

wescott@sauron.Columbia.NCR.COM (Mike Wescott) (02/22/89)

In the SysVr3v2 code, setvbuf(fp,buf,type,size) when called with buf==NULL will
malloc() a buffer of size, free()ing the old one if _IOMYBUF is set in
fp->_flags.  As used elsewhere in the stdio code _IOMYBUF is used to indicate
that the buffer has been malloc()ed in the stdio code and should be free()ed at
fclose() or when setvbuf(), or setbuf() overrides.

_IOMYBUF is NOT set in setvbuf when the buffer is malloc()ed. Shouldn't it be?
If not, how would the space get freed? No, I don't think the programmer should
do a free(fp->_base).
-- 
	-Mike Wescott
	 mike.wescott@ncrcae.Columbia.NCR.COM