krb5 commit: Fix nitpicky bugs in t_inq_cred

Greg Hudson ghudson at MIT.EDU
Sat Aug 11 18:20:59 EDT 2012


https://github.com/krb5/krb5/commit/bef36f694cb7745c60f1640dfa4d8a13ee08b883
commit bef36f694cb7745c60f1640dfa4d8a13ee08b883
Author: Greg Hudson <ghudson at mit.edu>
Date:   Sat Aug 11 17:57:40 2012 -0400

    Fix nitpicky bugs in t_inq_cred

 src/tests/gssapi/t_inq_cred.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/tests/gssapi/t_inq_cred.c b/src/tests/gssapi/t_inq_cred.c
index 5070a23..ed93a6e 100644
--- a/src/tests/gssapi/t_inq_cred.c
+++ b/src/tests/gssapi/t_inq_cred.c
@@ -79,7 +79,7 @@ static void
 usage(const char *progname)
 {
     fprintf(stderr,
-            "Usage: %s [-k|-s] [-a|-b|-i] [princ|gss:service at host|-]\n",
+            "Usage: %s [-k|-s] [-a|-b|-i] [princ|gss:service at host]\n",
             progname);
     exit(1);
 }
@@ -95,7 +95,7 @@ main(int argc, char *argv[])
     gss_cred_id_t cred = GSS_C_NO_CREDENTIAL;
     gss_name_t name = GSS_C_NO_NAME;
     gss_buffer_desc buf;
-    const char *name_arg = NULL;
+    const char *name_arg = NULL, *progname = argv[0];
     char opt;
 
     while (argc > 1 && argv[1][0] == '-') {
@@ -112,10 +112,10 @@ main(int argc, char *argv[])
         else if (opt == 's')
             mech = &spnego_mech;
         else
-            usage(argv[0]);
+            usage(progname);
     }
     if (argc > 2)
-        usage(argv[0]);
+        usage(progname);
     if (argc > 1)
         name_arg = argv[1];
 
@@ -124,8 +124,8 @@ main(int argc, char *argv[])
         /* Import as host-based service. */
         buf.value = (char *)name_arg + 4;
         buf.length = strlen((char *)buf.value);
-        major = gss_import_name(&minor, &buf,
-                                (gss_OID)GSS_C_NT_HOSTBASED_SERVICE, &name);
+        major = gss_import_name(&minor, &buf, GSS_C_NT_HOSTBASED_SERVICE,
+                                &name);
         if (GSS_ERROR(major))
             gsserr("gss_import_name", major, minor);
     } else if (name_arg != NULL) {


More information about the cvs-krb5 mailing list