From 2bdaae417591d4fda803b3f527bbb03f88d72c11 Mon Sep 17 00:00:00 2001
From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Thu, 3 Dec 2009 19:53:21 +0000
Subject: [PATCH] Avoid truncation of configure arguments in '-V' output.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2991 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 smartmontools/CHANGELOG   |  2 ++
 smartmontools/utility.cpp | 18 ++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG
index 91330338f..9106eb2f9 100644
--- a/smartmontools/CHANGELOG
+++ b/smartmontools/CHANGELOG
@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [CF] Avoid truncation of configure arguments in '-V' output.
+
   [AS] Added USB IDs of WD Passport USB Portable
 
   [CF] Linux: Fix segfault in 3ware interface (ticket #22).
diff --git a/smartmontools/utility.cpp b/smartmontools/utility.cpp
index 6a8f54624..134bf3349 100644
--- a/smartmontools/utility.cpp
+++ b/smartmontools/utility.cpp
@@ -102,21 +102,23 @@ std::string format_version_info(const char * prog_name, bool full /*= false*/)
     "software, and you are welcome to redistribute it under\n"
     "the terms of the GNU General Public License Version 2.\n"
     "See http://www.gnu.org for further details.\n"
-    "\n"
+    "\n",
+    prog_name
+  );
+  info += strprintf(
     "smartmontools release "PACKAGE_VERSION
       " dated "SMARTMONTOOLS_RELEASE_DATE" at "SMARTMONTOOLS_RELEASE_TIME"\n"
     "smartmontools SVN rev "SMARTMONTOOLS_SVN_REV
       " dated "SMARTMONTOOLS_SVN_DATE" at "SMARTMONTOOLS_SVN_TIME"\n"
     "smartmontools build host: "SMARTMONTOOLS_BUILD_HOST"\n"
     "smartmontools build configured: "SMARTMONTOOLS_CONFIGURE_DATE "\n"
-    "%s compile dated "__DATE__" at "__TIME__"\n",
-    prog_name, prog_name
-  );
-  info += strprintf(
-    "smartmontools configure arguments: %s\n",
-      (sizeof(SMARTMONTOOLS_CONFIGURE_ARGS) > 1 ?
-       SMARTMONTOOLS_CONFIGURE_ARGS : "[no arguments given]")
+    "%s compile dated "__DATE__" at "__TIME__"\n"
+    "smartmontools configure arguments: ",
+    prog_name
   );
+  info += (sizeof(SMARTMONTOOLS_CONFIGURE_ARGS) > 1 ?
+           SMARTMONTOOLS_CONFIGURE_ARGS : "[no arguments given]");
+  info += '\n';
 
   return info;
 }
-- 
GitLab