It’s friday evening, so it may just be that I’m not thinking straight, but I think I’ve discovered a bug when writing an XmlElement on one line to a FileOutputStream.
Try the following code in a basic non-gui introjucer’d app:
[code]int main (int argc, char* argv)
ScopedPointer stream (outputFile.createOutputStream());
element.writeToStream(*stream, juce::String::empty, true, false);
The key point here is that we are calling writeToStream with allOnOneLine set to true. This in turns calls XmlElement::writeElementAsText, with an indentation level of -1, which ultimately falls over when, in FileOutputStream::writeRepeatedByte with numBytes = -1, the program tries to :
memset (buffer + bytesInBuffer, byte, (size_t) numBytes);