if password less than 8 chars, it uses the newline
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 27 Mar 1989 11:39:22 +0000 (03:39 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 27 Mar 1989 11:39:22 +0000 (03:39 -0800)
SCCS-vsn: usr.bin/lock/lock.c 5.10

usr/src/usr.bin/lock/lock.c

index c40fc0f..916785d 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)lock.c     5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)lock.c     5.10 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -159,6 +159,7 @@ main(argc, argv)
                        continue;
                }
                if (usemine) {
                        continue;
                }
                if (usemine) {
+                       s[strlen(s) - 1] = '\0';
                        if (!strcmp(mypw, crypt(s, mypw)))
                                break;
                }
                        if (!strcmp(mypw, crypt(s, mypw)))
                                break;
                }