Skip to content

Commit 3b1064a

Browse files
committed
win32/fcrypt.c: Collapse some conditionals
We have macros that including perl.h gets us access to, and do the same thing more quickly than this did.
1 parent 02bc12f commit 3b1064a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

win32/fcrypt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/* Copyright (C) 1993 Eric Young - see README for more details */
33
#include <stdio.h>
44
#include <errno.h>
5+
#include "EXTERN.h"
6+
#include "perl.h"
57

68
/* Eric Young.
79
* This version of crypt has been developed from my MIT compatible
@@ -466,12 +468,10 @@ unsigned const char cov_2char[64]={
466468
};
467469

468470
/* 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 '/'
471+
permits [./0-9A-Za-z], since '.' and '/' are adjacent, we don't need
472+
individual checks for them
471473
*/
472-
#define good_for_salt(c) \
473-
((c) >= '.' && (c) <= '9' || (c) >= 'A' && (c) <= 'Z' || \
474-
(c) >= 'a' && (c) <= 'z')
474+
#define good_for_salt(c) (isALPHANUMERIC(c) || inRANGE((c), '.', '/'))
475475

476476
char *
477477
des_fcrypt(const char *buf, const char *salt, char *buff)

0 commit comments

Comments
 (0)