aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Houchard <cognet@FreeBSD.org>2003-10-19 02:09:36 +0000
committerOlivier Houchard <cognet@FreeBSD.org>2003-10-19 02:09:36 +0000
commitf6a43a2b50d5df170bc39ff8186dd216324d33b9 (patch)
tree3cc044603987f27c9dcfd3fb8e594f2873886673
parentd5e1f581ff195d23a3146a78447749597e78aa74 (diff)
Notes
-rw-r--r--usr.bin/su/su.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index f6d3ff3a0c45..dae818ff6349 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -520,10 +520,8 @@ chshell(char *sh)
r = 0;
setusershell();
- do {
- cp = getusershell();
- r = strcmp(cp, sh);
- } while (!r && cp != NULL);
+ while ((cp = getusershell()) != NULL && !r)
+ r = (strcmp(cp, sh) == 0);
endusershell();
return r;
}