From 44680760bfed7bd3386be7b3440cfc5a5c73ed4a Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Thu, 30 Apr 1998 23:29:32 +0000 Subject: [PATCH] (print_version): according to ISO/ANSI C the elements of `arg' are not constant and therefore not settable at compile-time. Set the at run-time instead. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4827 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/print_version.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/roken/print_version.c b/lib/roken/print_version.c index 04657b57b..d40dc412a 100644 --- a/lib/roken/print_version.c +++ b/lib/roken/print_version.c @@ -56,16 +56,24 @@ print_version(const char *progname) { const char *arg[] = { #ifdef KRB5 - heimdal_version, + NULL, #endif #ifdef KRB4 - krb4_version, + NULL, #endif }; const int num_args = sizeof(arg) / sizeof(arg[0]); char *msg; size_t len = 0; int i; + const char **p = arg; + +#ifdef KRB5 + *p++ = heimdal_version; +#endif +#ifdef KRB4 + *p++ = krb4_version; +#endif if(progname == NULL) progname = __progname;