Fix yaz-marcdump -n (bug #3028).
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Sep 2009 07:13:18 +0000 (09:13 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Sep 2009 07:13:18 +0000 (09:13 +0200)
util/marcdump.c

index e09de98..15021fe 100644 (file)
@@ -341,7 +341,7 @@ static void dump(const char *fname, const char *from, const char *to,
             }
             len_result = rlen;
             r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result);
             }
             len_result = rlen;
             r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result);
-            if (r > 0 && result)
+            if (r > 0 && result && len_result)
             {
                 if (fwrite(result, len_result, 1, stdout) != 1)
                 {
             {
                 if (fwrite(result, len_result, 1, stdout) != 1)
                 {