CCL: split-list deals with use attr YAZ-844
[yaz-moved-to-github.git] / util / marcdump.c
index c45d146..adfc015 100644 (file)
@@ -46,6 +46,7 @@
 #include <yaz/yaz-util.h>
 #include <yaz/xmalloc.h>
 #include <yaz/options.h>
+#include <yaz/backtrace.h>
 
 #ifndef SEEK_SET
 #define SEEK_SET 0
@@ -434,7 +435,7 @@ static void dump(const char *fname, const char *from, const char *to,
             {
                 cd1 = yaz_iconv_open(to, "utf-8");
                 if (cd1)
-                    yaz_marc_iconv(mt, cd);
+                    yaz_marc_iconv(mt, cd1);
             }
             r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result);
 
@@ -522,6 +523,7 @@ int main (int argc, char **argv)
 #endif
 
     prog = *argv;
+    yaz_enable_panic_backtrace(prog);
     while ((r = options("i:o:C:npc:xOeXIf:t:s:l:Vv", argv, argc, &arg)) != -2)
     {
         no++;