From: fcambus Date: Wed, 15 Aug 2018 19:38:47 +0000 (+0000) Subject: Remove dead assignment in login(1). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9dfbac94e431c2a25fb1ea941b32878475b5816e;p=openbsd Remove dead assignment in login(1). Since rev 1.36, the instance variable is never read again so we can simply drop the else clause with the assignment. While there, also drop the useless increment, as pointed out by tom@. OK deraadt@ (previous version), millert@, tom@ --- diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index edbb4d48c87..38afe1cc6a4 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login.c,v 1.69 2017/12/08 17:04:15 deraadt Exp $ */ +/* $OpenBSD: login.c,v 1.70 2018/08/15 19:38:47 fcambus Exp $ */ /* $NetBSD: login.c,v 1.13 1996/05/15 23:50:16 jtc Exp $ */ /*- @@ -405,9 +405,8 @@ main(int argc, char *argv[]) if ((instance = strchr(username, '/')) != NULL) { if (strncmp(instance + 1, "root", 4) == 0) rootlogin = 1; - *instance++ = '\0'; - } else - instance = ""; + *instance = '\0'; + } if (strlen(username) > UT_NAMESIZE) username[UT_NAMESIZE] = '\0';