🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Mike Wescott Wed, 22 Feb 1989 03:33
bug in setvbuf
#976
Author: Mike Wescott
Date: Wed, 22 Feb 1989 03:33
12 lines
1089 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads