diff options
author | Stefan Kost <ensonic@users.sf.net> | 2011-05-09 12:14:59 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2011-05-21 21:56:50 +0300 |
commit | dff8d0f726cecc2cc9265bc7148333bcf6d8ac0c (patch) | |
tree | b437c8b998378ffb5605a65b74ff264bdb600e91 /xmllint.c | |
parent | 4ea1866f7d98d7c0fceec0f5788b769977c1e7ee (diff) | |
download | android_external_libxml2-dff8d0f726cecc2cc9265bc7148333bcf6d8ac0c.tar.gz android_external_libxml2-dff8d0f726cecc2cc9265bc7148333bcf6d8ac0c.tar.bz2 android_external_libxml2-dff8d0f726cecc2cc9265bc7148333bcf6d8ac0c.zip |
various: handle return values of write calls
Diffstat (limited to 'xmllint.c')
-rw-r--r-- | xmllint.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -2550,7 +2550,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_0, NULL, 1, &result); if (size >= 0) { - write(1, result, size); + if (write(1, result, size) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } else { fprintf(stderr, "Failed to canonicalize\n"); @@ -2562,7 +2564,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_1, NULL, 1, &result); if (size >= 0) { - write(1, result, size); + if (write(1, result, size) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } else { fprintf(stderr, "Failed to canonicalize\n"); @@ -2575,7 +2579,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_EXCLUSIVE_1_0, NULL, 1, &result); if (size >= 0) { - write(1, result, size); + if (write(1, result, size) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } else { fprintf(stderr, "Failed to canonicalize\n"); @@ -2604,7 +2610,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { fprintf(stderr, "Failed to save\n"); progresult = XMLLINT_ERR_OUT; } else { - write(1, result, len); + if (write(1, result, len) == -1) { + fprintf(stderr, "Can't write data\n"); + } xmlFree(result); } |