[xml] xmlSaveToFd: unexpected behavior while redirecting the 'stdout' stream to a file

2018-04-03 Thread YuGiOhJCJ Mailing-List via xml
Hello, I think I found an unexpected behavior of the 'xmlSaveToFd' function while redirecting the 'stdout' stream to a file, with libxml2 2.9.4. Here is the code: --- #include /* for xmlSaveToFd */ #include /* for printf */ #include /* for strlen */ int main() { const char *str = "htt

Re: [xml] xmlSaveToFd: unexpected behavior while redirecting the 'stdout' stream to a file

2018-04-03 Thread Nick Wellnhofer
On 03/04/2018 14:02, YuGiOhJCJ Mailing-List via xml wrote: printf("Content-Type: application/xhtml+xml;\n\n"); This operates on the stdout FILE pointer using buffered IO. ctxt = xmlSaveToFd(1, NULL, XML_SAVE_FORMAT); This operates on the stdout file descriptor using unbuffer