Re: Remove dead assignment in login(1)
>>> Tom Cosgrove 7-Aug-18 20:14 >>> > > >>> Frederic Cambus 7-Aug-18 16:15 >>> > > > > Hi tech@, > > > > Since rev 1.36, the instance variable is never read again so we can > > simply drop the else clause with the assignment. > > > > Comments? OK? > > > > Index: usr.bin/login/login.c > > = > RCS file: /cvs/src/usr.bin/login/login.c,v > > retrieving revision 1.69 > > diff -u -p -r1.69 login.c > > --- usr.bin/login/login.c 8 Dec 2017 17:04:15 - 1.69 > > +++ usr.bin/login/login.c 7 Aug 2018 13:47:00 - > > @@ -406,8 +406,7 @@ main(int argc, char *argv[]) > > if (strncmp(instance + 1, "root", 4) == 0) > > rootlogin = 1; > > *instance++ = '\0'; > > You should also remove this line ^ Err, no you shouldn't - sorry. (Note to self: don't email after alcohol, especially to lists) Just ok tom@ > > - } else > > - instance = ""; > > + } > > > > if (strlen(username) > UT_NAMESIZE) > > username[UT_NAMESIZE] = '\0';
Re: Remove dead assignment in login(1)
>>> Frederic Cambus 7-Aug-18 16:15 >>> > > Hi tech@, > > Since rev 1.36, the instance variable is never read again so we can > simply drop the else clause with the assignment. > > Comments? OK? > > Index: usr.bin/login/login.c > == > RCS file: /cvs/src/usr.bin/login/login.c,v > retrieving revision 1.69 > diff -u -p -r1.69 login.c > --- usr.bin/login/login.c 8 Dec 2017 17:04:15 - 1.69 > +++ usr.bin/login/login.c 7 Aug 2018 13:47:00 - > @@ -406,8 +406,7 @@ main(int argc, char *argv[]) > if (strncmp(instance + 1, "root", 4) == 0) > rootlogin = 1; > *instance++ = '\0'; You should also remove this line ^ With that, ok tom@ > - } else > - instance = ""; > + } > > if (strlen(username) > UT_NAMESIZE) > username[UT_NAMESIZE] = '\0';
Re: Remove dead assignment in login(1)
On Tue, 07 Aug 2018 17:15:58 +0200, Frederic Cambus wrote: > Since rev 1.36, the instance variable is never read again so we can > simply drop the else clause with the assignment. OK millert@ - todd
Remove dead assignment in login(1)
Hi tech@, Since rev 1.36, the instance variable is never read again so we can simply drop the else clause with the assignment. Comments? OK? Index: usr.bin/login/login.c === RCS file: /cvs/src/usr.bin/login/login.c,v retrieving revision 1.69 diff -u -p -r1.69 login.c --- usr.bin/login/login.c 8 Dec 2017 17:04:15 - 1.69 +++ usr.bin/login/login.c 7 Aug 2018 13:47:00 - @@ -406,8 +406,7 @@ main(int argc, char *argv[]) if (strncmp(instance + 1, "root", 4) == 0) rootlogin = 1; *instance++ = '\0'; - } else - instance = ""; + } if (strlen(username) > UT_NAMESIZE) username[UT_NAMESIZE] = '\0';