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