Skip to content

Commit 6617266

Browse files
committed
win32/fcrypt.c: Collapse some conditionals
We have macros that more quickly do the same thing this code is intended to do.
1 parent d4c2c3c commit 6617266

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

win32/fcrypt.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,10 @@ unsigned const char cov_2char[64]={
466466
};
467467

468468
/* the salt for classic DES crypt (which is all we implement here)
469-
permits [./0-9A-Za-z], since '.' and '/' immediately precede
470-
'0' we don't need individual checks for '.' and '/'
469+
permits [./0-9A-Za-z], since '.' and '/' are adjacent, we don't need
470+
individual checks for them
471471
*/
472-
#define good_for_salt(c) \
473-
((c) >= '.' && (c) <= '9' || (c) >= 'A' && (c) <= 'Z' || \
474-
(c) >= 'a' && (c) <= 'z')
472+
#define good_for_salt(c) (isALPHANUMERIC(c) || inRANGE((c), '.', '/'))
475473

476474
char *
477475
des_fcrypt(const char *buf, const char *salt, char *buff)

0 commit comments

Comments
 (0)