Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site wateng.UUCP Path: utzoo!watmath!wateng!ksbszabo From: ksbszabo@wateng.UUCP (Kevin Szabo) Newsgroups: net.unix-wizards Subject: Re: Plexus P/40 System III Release 1.2 'C' compiler/library bug Message-ID: <2142@wateng.UUCP> Date: Wed, 13-Mar-85 01:30:15 EST Article-I.D.: wateng.2142 Posted: Wed Mar 13 01:30:15 1985 Date-Received: Wed, 13-Mar-85 02:27:41 EST References: <395@aicchi.UUCP> Reply-To: ksbszabo@wateng.UUCP (Kevin Szabo) Distribution: net Organization: VLSI Group, U of Waterloo Lines: 17 Summary: In article <395@aicchi.UUCP> ignatz@aicchi.UUCP (Ihnat) writes: > char buff[64]; > setbuf(stdout,buff); > >Some boring poking with adb resulted in the not surprising >fact that the stack and data were crawling down each other's >throats; the only surprising thing was that this happened at all >on such a small, simple program. Has anyone else found this? Setbuf expects the buffer to be BUFSIZ big. STDIO has no way of finding out how big your buffer really is. Reading the man page for SETBUF should clarify this. Peeking at the source ain't bad either. Kevin -- Kevin Szabo watmath!wateng!ksbszabo (U of Waterloo VLSI Group, Waterloo Ont.)