removed StartLibCitadel()
[citadel.git] / libcitadel / tests / mimeparser_test.c
index 57decd88750e41bbdf72c8608cf097525a806f95..a78fcaf18af5e2b656383412c4bfa5fa1c626116 100644 (file)
@@ -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);
+               }
        }
 }
 
@@ -229,7 +234,6 @@ int main(int argc, char* argv[])
                        ma.printme = optarg;
                }
        }
-       StartLibCitadel(8);
 
        if (filename == NULL) {
                printf("Filename requried! -f\n");