projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
486475b
)
Correctly evaluate whether we have a decoded mime part, or if we need to output the...
author
Wilfried Goesgens
<dothebart@citadel.org>
Tue, 7 Dec 2010 22:30:12 +0000
(23:30 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Tue, 7 Dec 2010 22:30:12 +0000
(23:30 +0100)
libcitadel/tests/mimeparser_test.c
patch
|
blob
|
history
diff --git
a/libcitadel/tests/mimeparser_test.c
b/libcitadel/tests/mimeparser_test.c
index 57decd88750e41bbdf72c8608cf097525a806f95..acb1a0087d28f89a21bcbd401ec32c3e741d66c0 100644
(file)
--- a/
libcitadel/tests/mimeparser_test.c
+++ b/
libcitadel/tests/mimeparser_test.c
@@
-145,12
+145,17
@@
static void mime_download(char *name,
encoding,
&decoded,
&bytes_decoded);
- if (
(rc < 0) || (decoded == NULL)
) {
+ if (
rc < 0
) {
printf("failed to decode content\n");
return;
}
- rc = write(STDOUT_FILENO, content, length);
- free(decoded);
+ if (rc == 0){
+ rc = write(STDOUT_FILENO, content, length);
+ }
+ else {
+ rc = write(STDOUT_FILENO, decoded, bytes_decoded);
+ free(decoded);
+ }
}
}