fix typo in calculating buffer size
authorKen Raeburn <raeburn@mit.edu>
Mon, 26 Jul 1999 21:16:22 +0000 (21:16 +0000)
committerKen Raeburn <raeburn@mit.edu>
Mon, 26 Jul 1999 21:16:22 +0000 (21:16 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11606 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/login.c

index c3718e798cf4fded8f4e8406e3399ae609c18d7e..b0c1d4b2fef85883a5bff85355de77d0071f0064 100644 (file)
@@ -1,3 +1,8 @@
+1999-07-26  Ken Raeburn  <raeburn@mit.edu>
+
+       * login.c (main): Fix typo in computing strncpy length for shell
+       name.
+
 Sat Jul 24 08:50:39 1999  Ezra Peisach  <epeisach@mit.edu>
 
        * Makefile.in (kshd): Add $(LOGINLIBS).
index c9912763c97a53aa9b0529b55abbc2462a5fad0f..2eaf822dc838f5b797b28acebe06280a4e3398a9 100644 (file)
@@ -1821,7 +1821,7 @@ int main(argc, argv)
 
     tbuf[0] = '-';
     p = strrchr(pwd->pw_shell, '/');
-    (void) strncpy(tbuf+1, p?(p+1):pwd->pw_shell, sizeof(tbuf-1));
+    (void) strncpy(tbuf+1, p?(p+1):pwd->pw_shell, sizeof(tbuf) - 1);
     tbuf[sizeof(tbuf) - 1] = '\0';
 
     execlp(pwd->pw_shell, tbuf, 0);