From 349490659c2fb3b0c937feeae4a1b5ff5264dd7c Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Wed, 2 Aug 2000 14:48:57 +0000 Subject: [PATCH] * kvno.c (main): Compiler warning fixes - declare usage as static, and break out assignments within conditionals. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12596 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kvno/ChangeLog | 5 +++++ src/clients/kvno/kvno.c | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/clients/kvno/ChangeLog b/src/clients/kvno/ChangeLog index ca9685088..459dea492 100644 --- a/src/clients/kvno/ChangeLog +++ b/src/clients/kvno/ChangeLog @@ -1,3 +1,8 @@ +2000-08-02 Ezra Peisach + + * kvno.c (main): Compiler warning fixes - declare usage as static, and + break out assignments within conditionals. + 2000-02-01 Danilo Almeida * kvno.c (main): Use krb5_decode_ticket() instead of diff --git a/src/clients/kvno/kvno.c b/src/clients/kvno/kvno.c index 35ad8c37c..b4d2993ae 100644 --- a/src/clients/kvno/kvno.c +++ b/src/clients/kvno/kvno.c @@ -31,7 +31,7 @@ extern int optind; extern char *optarg; -void usage(char *argv0) +static void usage(char *argv0) { char *cmd; @@ -57,7 +57,8 @@ int main(int argc, char *argv[]) krb5_ticket *ticket; char *princ; - if (ret = krb5_init_context(&context)) { + ret = krb5_init_context(&context); + if (ret) { com_err(argv[0], ret, "while initializing krb5 library"); exit(1); } @@ -83,7 +84,8 @@ int main(int argc, char *argv[]) usage(argv[0]); if (etypestr) { - if (ret = krb5_string_to_enctype(etypestr, &etype)) { + ret = krb5_string_to_enctype(etypestr, &etype); + if (ret) { com_err(argv[0], ret, "while converting etype"); exit(1); } @@ -91,12 +93,14 @@ int main(int argc, char *argv[]) etype = 0; } - if (ret = krb5_cc_default(context, &ccache)) { + ret = krb5_cc_default(context, &ccache); + if (ret) { com_err(argv[0], ret, "while opening ccache"); exit(1); } - if (ret = krb5_cc_get_principal(context, ccache, &me)) { + ret = krb5_cc_get_principal(context, ccache, &me); + if (ret) { com_err(argv[0], ret, "while getting client principal name"); exit(1); } @@ -108,7 +112,8 @@ int main(int argc, char *argv[]) in_creds.client = me; - if (ret = krb5_parse_name(context, argv[i], &in_creds.server)) { + ret = krb5_parse_name(context, argv[i], &in_creds.server); + if (ret) { if (!quiet) fprintf(stderr, "%s: %s while parsing principal name\n", argv[i], error_message(ret)); @@ -116,7 +121,8 @@ int main(int argc, char *argv[]) continue; } - if (ret = krb5_unparse_name(context, in_creds.server, &princ)) { + ret = krb5_unparse_name(context, in_creds.server, &princ); + if (ret) { fprintf(stderr, "%s: %s while printing principal name\n", argv[i], error_message(ret)); errors++; @@ -140,7 +146,8 @@ int main(int argc, char *argv[]) } /* we need a native ticket */ - if (ret = krb5_decode_ticket(&out_creds->ticket, &ticket)) { + ret = krb5_decode_ticket(&out_creds->ticket, &ticket); + if (ret) { fprintf(stderr, "%s: %s while decoding ticket\n", princ, error_message(ret)); -- 2.26.2