lib/port.c: getttyuser(): Use goto to break out of nested loops
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
a4b91048e9
commit
bf84b3a855
+4
-6
@@ -353,15 +353,13 @@ static struct port *getttyuser (const char *tty, const char *user)
|
||||
|
||||
for (j = 0; NULL != port->pt_users[j]; j++) {
|
||||
if ( (strcmp (user, port->pt_users[j]) == 0)
|
||||
|| (strcmp (port->pt_users[j], "*") == 0)) {
|
||||
break;
|
||||
|| (strcmp (port->pt_users[j], "*") == 0))
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (port->pt_users[j] != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
end:
|
||||
endportent ();
|
||||
return port;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user