(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
This commit is contained in:
@@ -56,16 +56,24 @@ print_version(const char *progname)
|
|||||||
{
|
{
|
||||||
const char *arg[] = {
|
const char *arg[] = {
|
||||||
#ifdef KRB5
|
#ifdef KRB5
|
||||||
heimdal_version,
|
NULL,
|
||||||
#endif
|
#endif
|
||||||
#ifdef KRB4
|
#ifdef KRB4
|
||||||
krb4_version,
|
NULL,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
const int num_args = sizeof(arg) / sizeof(arg[0]);
|
const int num_args = sizeof(arg) / sizeof(arg[0]);
|
||||||
char *msg;
|
char *msg;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int i;
|
int i;
|
||||||
|
const char **p = arg;
|
||||||
|
|
||||||
|
#ifdef KRB5
|
||||||
|
*p++ = heimdal_version;
|
||||||
|
#endif
|
||||||
|
#ifdef KRB4
|
||||||
|
*p++ = krb4_version;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(progname == NULL)
|
if(progname == NULL)
|
||||||
progname = __progname;
|
progname = __progname;
|
||||||
|
Reference in New Issue
Block a user