Fix two annoying things in kadmin5
authorPaul Park <pjpark@mit.edu>
Thu, 11 May 1995 16:20:05 +0000 (16:20 +0000)
committerPaul Park <pjpark@mit.edu>
Thu, 11 May 1995 16:20:05 +0000 (16:20 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5796 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/v5client/ChangeLog
src/kadmin/v5client/kadmin5.c

index bafbabddd63bbc18c994838d53ef4a90dd38a6c5..cd80c44b207a78dbbdbea6ab0cc72a2cd73fc877 100644 (file)
@@ -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.
 
index 0538c9ee0e75fb6789afd4169852e7400eb4ed7a..8c903b9e2309332fb58d388091f46a2dc4762036 100644 (file)
@@ -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);