make sure null padded when writing in /etc/utmp
authorRick Adams <rick@ucbvax.Berkeley.EDU>
Wed, 6 Apr 1988 03:28:20 +0000 (19:28 -0800)
committerRick Adams <rick@ucbvax.Berkeley.EDU>
Wed, 6 Apr 1988 03:28:20 +0000 (19:28 -0800)
SCCS-vsn: usr.bin/uucp/acucntrl/acucntrl.c 5.12

usr/src/usr.bin/uucp/acucntrl/acucntrl.c

index 4735e2c..0baa41a 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)acucntrl.c 5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)acucntrl.c 5.12    (Berkeley) %G%";
 #endif
 
 /*  acucntrl - turn around tty line between dialin and dialout
 #endif
 
 /*  acucntrl - turn around tty line between dialin and dialout
@@ -201,10 +201,8 @@ int argc; char *argv[];
        i = 0;
        do {
                uname[i] = *p;
        i = 0;
        do {
                uname[i] = *p;
-               Uname[i] = (*p>='a' && *p<='z') ? (*p - ('a'-'A')) : *p;
-               i++; p++;
-       } while (*p && i<NAMSIZ);
-
+               Uname[i++] = (*p>='a' && *p<='z') ? (*p - ('a'-'A')) : *p;
+       } while (*p++ && i<NAMSIZ);
 
        /* check to see if line is being used */
        if( (etcutmp = open(Etcutmp, 2)) < 0) {
 
        /* check to see if line is being used */
        if( (etcutmp = open(Etcutmp, 2)) < 0) {