changeset 1063:ada47e30d0c9

Adjust program banner printing.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 02 Mar 2015 01:46:19 +0200
parents d36bf7514614
children a6c5be712b53
files src/dmlib.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/dmlib.c	Mon Mar 02 00:03:13 2015 +0200
+++ b/src/dmlib.c	Mon Mar 02 01:46:19 2015 +0200
@@ -22,13 +22,20 @@
 
 void dmPrintBanner(FILE *outFile, const char *name, const char *usage)
 {
-    fprintf(outFile,
-        "\n%s v%s (%s)\n"
-        "%s\n"
-        "%s\n"
-        "Usage: %s %s\n",
-        dmProgName, dmProgVersion, dmProgDesc,
-        dmProgAuthor, dmProgLicense, name, usage);
+    fprintf(outFile, "\n%s", dmProgName);
+    if (dmProgVersion != NULL)
+        fprintf(outFile, " v%s", dmProgVersion);
+    if (dmProgDesc != NULL)
+        fprintf(outFile, " (%s)", dmProgDesc);
+    fprintf(outFile, "\n");
+
+    if (dmProgAuthor != NULL)
+        fprintf(outFile, "%s\n", dmProgAuthor);
+
+    if (dmProgLicense != NULL)
+        fprintf(outFile, "%s\n", dmProgLicense);
+
+    fprintf(outFile, "Usage: %s %s\n", name, usage);
 }