--- embedaddon/libxml2/testC14N.c 2012/02/21 23:37:58 1.1.1.1 +++ embedaddon/libxml2/testC14N.c 2013/07/22 01:22:20 1.1.1.2 @@ -13,7 +13,9 @@ #include #ifdef HAVE_UNISTD_H #include -#endif +#else +#define STDOUT_FILENO fileno(stdout) +#endif /* HAVE_UNISTD_H */ #ifdef HAVE_STDLIB_H #include #endif @@ -104,8 +106,10 @@ test_c14n(const char* xml_filename, int with_comments, with_comments, &result); if(ret >= 0) { if(result != NULL) { - write(1, result, ret); - xmlFree(result); + if (write(STDOUT_FILENO, result, ret) == -1) { + fprintf(stderr, "Can't write data\n"); + } + xmlFree(result); } } else { fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret);