record_conv: fix error handling for marc charsets mis
[yaz-moved-to-github.git] / src / record_conv.c
index bf3c362..a272aee 100644 (file)
@@ -374,14 +374,14 @@ static void *construct_marc(const xmlNode *ptr,
         }
         yaz_iconv_close(cd);
     }
-    else if (info->input_charset)
+    else if (!info->output_charset)
     {
         wrbuf_printf(wr_error, "Element <marc>: "
                      "attribute 'outputcharset' missing");
         nmem_destroy(info->nmem);
         return 0;
     }
-    else if (info->output_charset)
+    else if (!info->input_charset)
     {
         wrbuf_printf(wr_error, "Element <marc>: "
                      "attribute 'inputcharset' missing");