Fix yaz-marcdump -n (bug #3028).
[yaz-moved-to-github.git] / util / marcdump.c
index 43ff281..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);
-            if (r > 0 && result)
+            if (r > 0 && result && len_result)
             {
                 if (fwrite(result, len_result, 1, stdout) != 1)
                 {
@@ -530,6 +530,7 @@ int main (int argc, char **argv)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab