]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/, src/: Reorder while() conditions for safety
authorAlejandro Colomar <alx@kernel.org>
Fri, 18 Jul 2025 10:23:42 +0000 (12:23 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sat, 9 Aug 2025 22:03:22 +0000 (17:03 -0500)
commit2ff16902d125fa81b52579d488babcc0e6ffe5d0
treebb83cf4ca825ba6ed491484878e87f337992ec95
parent841776561f56bae7382c6bd47e428201a155d39c
lib/, src/: Reorder while() conditions for safety

In conditions that perform simple assignment (=) before comparison,
it's safer to put the comparison first, as a mistake would result in a
compiler error, as opposed to assigning something incorrect.
It's also more readable, IMO.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
19 files changed:
lib/copydir.c
lib/find_new_gid.c
lib/find_new_uid.c
lib/gshadow.c
lib/port.c
lib/prefix_flag.c
lib/subordinateio.c
lib/user_busy.c
lib/utmp.c
src/groupmod.c
src/grpconv.c
src/grpunconv.c
src/logoutd.c
src/newgrp.c
src/pwconv.c
src/pwunconv.c
src/su.c
src/userdel.c
src/usermod.c