From: Wolfgang Stöggl Date: Wed, 23 Mar 2022 16:58:45 +0000 (+0100) Subject: Fix BUILD_DATE in rrdtool help output X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e59f703bbcc0af949ee365206426b6394c340c6f;p=thirdparty%2Frrdtool-1.x.git Fix BUILD_DATE in rrdtool help output - 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 --- diff --git a/configure.ac b/configure.ac index 4d234585..5169b0d4 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 930d0827..cc6119d9 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -45,11 +45,19 @@ static void PrintUsage( char *cmd) { +#ifdef BUILD_DATE + const char *help_main = + N_("RRDtool %s" + " Copyright by Tobias Oetiker \n" + " Compiled %s\n\n" + "Usage: rrdtool [options] command command_options\n"); +#else const char *help_main = N_("RRDtool %s" " Copyright by Tobias Oetiker \n" " Compiled %s %s\n\n" "Usage: rrdtool [options] command command_options\n"); +#endif const char *help_list = N_