From b9e88f5d2dfadcf3fc55e10bcbea035d3fcacf23 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 26 Jul 1999 21:16:22 +0000 Subject: [PATCH] fix typo in calculating buffer size git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11606 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 5 +++++ src/appl/bsd/login.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index c3718e798..b0c1d4b2f 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,8 @@ +1999-07-26 Ken Raeburn + + * login.c (main): Fix typo in computing strncpy length for shell + name. + Sat Jul 24 08:50:39 1999 Ezra Peisach * Makefile.in (kshd): Add $(LOGINLIBS). diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index c9912763c..2eaf822dc 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -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); -- 2.26.2