]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/port.c: getttyuser(): Remove dead code
authorAlejandro Colomar <alx@kernel.org>
Tue, 2 Jul 2024 12:03:27 +0000 (14:03 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sat, 6 Jul 2024 12:44:02 +0000 (07:44 -0500)
commita4b91048e9b5fde02722d68c285f8545a0f75fc6
treecc4e981f1d891546abd013eef1210195c47ce205
parent53ea42e67f6ed3ca1f7eae69a3992774be627a45
lib/port.c: getttyuser(): Remove dead code

port.pt_names cannot be NULL; it always points to the static array ttys.

$ grep -rn pt_names
lib/port.c:157: port.pt_names = ttys;
lib/port.c:159: port.pt_names[j] = cp;
lib/port.c:172: port.pt_names[j] = NULL;
lib/port.c:344: for (i = 0; NULL != port->pt_names[i]; i++) {
lib/port.c:345: if (portcmp (port->pt_names[i], tty) == 0) {
lib/port.c:350: if (port->pt_names[i] == 0) {
lib/port.h:39: * pt_names - pointer to array of device names in /dev/
lib/port.h:45: char **pt_names;

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/port.c