userauth.c: improve readability and clarity of for-loops