]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fix BUILD_DATE in rrdtool help output 1165/head
authorWolfgang Stöggl <c72578@yahoo.de>
Wed, 23 Mar 2022 16:58:45 +0000 (17:58 +0100)
committerWolfgang Stöggl <c72578@yahoo.de>
Wed, 23 Mar 2022 18:25:00 +0000 (19:25 +0100)
- This is a followup to #1102
- Fixes segfault when running "rrdtool --help"
- Change DATE_FMT to the same date format as the __DATE__ macro [1]:
  mmm dd yyyy

[1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

configure.ac
src/rrd_tool.c

index 4d2345855bf9ecdab9716c29575b2ac8b6c59f7c..5169b0d49f223fbc59426ce7e2b7741a45efcd09 100644 (file)
@@ -695,7 +695,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
 
 # Use reproducible build date and time
 if test "$SOURCE_DATE_EPOCH"; then
-       DATE_FMT="%d %b %Y %H:%M:%S"
+       DATE_FMT="%b %d %Y %H:%M:%S"
        BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT")
        AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducible build date])
 fi
index 930d0827271809cb77dd67b08acbe793f6103741..cc6119d9afb9e0b7272b1a70458dc382c5a83280 100644 (file)
@@ -45,11 +45,19 @@ static void PrintUsage(
     char *cmd)
 {
 
+#ifdef BUILD_DATE
+    const char *help_main =
+        N_("RRDtool %s"
+           "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
+           "               Compiled %s\n\n"
+           "Usage: rrdtool [options] command command_options\n");
+#else
     const char *help_main =
         N_("RRDtool %s"
            "  Copyright by Tobias Oetiker <tobi@oetiker.ch>\n"
            "               Compiled %s %s\n\n"
            "Usage: rrdtool [options] command command_options\n");
+#endif
 
     const char *help_list =
         N_