From: Paul Park Date: Thu, 11 May 1995 16:20:05 +0000 (+0000) Subject: Fix two annoying things in kadmin5 X-Git-Tag: krb5-1.0-beta6~2001 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f8604c5c36684cd26855231006ab59d36256bd6b;p=krb5.git Fix two annoying things in kadmin5 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5796 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/v5client/ChangeLog b/src/kadmin/v5client/ChangeLog index bafbabddd..cd80c44b2 100644 --- a/src/kadmin/v5client/ChangeLog +++ b/src/kadmin/v5client/ChangeLog @@ -1,4 +1,10 @@ +Thu May 11 12:18:27 EDT 1995 Paul Park (pjpark@mit.edu) + * kadmin5.c - Change "programname" to be the last component of + argv[0]. Also correctly terminate generated + argument string in kadmin_startup. + + Tue May 9 15:56:40 EDT 1995 Paul Park (pjpark@mit.edu) First checkin of new administrative client. diff --git a/src/kadmin/v5client/kadmin5.c b/src/kadmin/v5client/kadmin5.c index 0538c9ee0..8c903b9e2 100644 --- a/src/kadmin/v5client/kadmin5.c +++ b/src/kadmin/v5client/kadmin5.c @@ -1278,7 +1278,8 @@ kadmin_startup(argc, argv) extern int optind; char *action = (char *) NULL; - programname = argv[0]; + programname = strrchr(argv[0], (int) '/'); + programname = (programname) ? programname++ : argv[0]; while ((option = getopt(argc, argv, "r:p:mt:")) != EOF) { switch (option) { case 'r': @@ -1417,6 +1418,7 @@ kadmin_startup(argc, argv) strcat(action, argv[i]); strcat(action, " "); } + action[n2alloc-1] = '\0'; } } return(action);