changeset 140:9f96b37c4f75

Don't print songlengths field if there are none.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 02 Jun 2017 07:39:19 +0300
parents 830125ad15c4
children 71725be55ed1
files sidinfo.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/sidinfo.c	Fri Jun 02 04:40:03 2017 +0300
+++ b/sidinfo.c	Fri Jun 02 07:39:19 2017 +0300
@@ -525,24 +525,26 @@
         case 20: PR("%s", NULL, psid->sidCopyright); break;
 
         case 21:
-            siPrintFieldPrefix(outFile, opt);
-            th_md5_print(outFile, psid->hash);
-            siPrintFieldSeparator(outFile);
+            {
+                siPrintFieldPrefix(outFile, opt);
+                th_md5_print(outFile, psid->hash);
+                siPrintFieldSeparator(outFile);
+            }
             break;
 
         case 22:
-            siPrintFieldPrefix(outFile, opt);
             if (psid->lengths != NULL)
             {
                 int i;
+                siPrintFieldPrefix(outFile, opt);
                 for (i = 0; i < psid->lengths->nlengths; i++)
                 {
                     int len = psid->lengths->lengths[i];
                     fprintf(outFile, "%d:%d%s", len / 60, len % 60,
                         (i < psid->lengths->nlengths - 1) ? " " : "");
                 }
+                siPrintFieldSeparator(outFile);
             }
-            siPrintFieldSeparator(outFile);
             break;
     }
 }