Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!think.com!snorkelwacker.mit.edu!stanford.edu!saber.com!wyant From: wyant@saber.com Newsgroups: comp.windows.interviews Subject: bug in Doc in handling default empty document Message-ID: <9106051517.AA22644@riposte> Date: 5 Jun 91 15:17:32 GMT Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Lines: 16 When Doc is started without specifying a document, Application::read creates a default one in a strstream. Document::read reads a line in from the stream. The final 'else' of the massive 'if' statement that starts this function looks for a "%" on the line. It expects this to be followed by a space. However, the empty document created by Application::read does not provide this. This will cause the strncat in that 'else' clause to fill the 'name' variable with garbage. The fix seems to be change Application::read to procede the newline it puts in the stream with a space: empty << " \n"; --geoff wyant C++ Technologies Group Saber Software wyant@saber.com