Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!munnari!uqcspe!bunyip!uqvax!csvax!cszohagan From: cszohagan@qut.edu.au Newsgroups: comp.lang.c++ Subject: Re: Zortech bugs Message-ID: <2527@qut.edu.au> Date: 14 Feb 89 13:11:06 GMT References: <2118@windy.dsir.govt.nz> <4800049@m.cs.uiuc.edu> <1866@dataio.Data-IO.COM> Organization: Queensland University of Technology Lines: 21 In my attempts (as yet uncomplete) to tie in the back end of streams i/o into a type window, I came accross a bug in Zortech's definition of . The 2nd constructor for streambuf is missing an initialisation for the variable "FILE* fp". This causes problems in the sputc() function below if performing i/o on a buffer (as opposed to a file pointer). Useful info if you ever get stuck fiddling with the back end of stream i/o is that doallocate() allocates 1k chunks of memory and sets the alloc flag to 1. include/stream.hpp ------------------ < streambuf(char* buf, int buflen) { setbuf(buf,buflen); alloc = 0; } > streambuf(char* buf, int buflen) { > setbuf(buf,buflen); alloc = 0; > fp = (FILE *) 0; > } Thanks Walter, I'm enjoying C++, Tony O'Hagan