CVS update: php3/functions
| From: | rasmus | Date: | Fri, 11 Jun 1999 12:17:48 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6819@lists.php.net to get a copy of this message | ||
Date: Friday June 11, 1999 @ 8:17
Author: rasmus
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv31576/functions
Modified Files:
crypt.c
Log Message:
Fix #ifdef/#if confusion (bug #1526)
Index: php3/functions/crypt.c
diff -u php3/functions/crypt.c:1.44 php3/functions/crypt.c:1.45
--- php3/functions/crypt.c:1.44 Tue Mar 30 23:18:51 1999
+++ php3/functions/crypt.c Fri Jun 11 08:17:47 1999
@@ -28,7 +28,7 @@
| Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: crypt.c,v 1.44 1999/03/31 04:18:51 rasmus Exp $ */
+/* $Id: crypt.c,v 1.45 1999/06/11 12:17:47 rasmus Exp $ */
#include <stdlib.h>
#include "php.h"
@@ -76,26 +76,26 @@
PHP3_EXT_DES_CRYPT, PHP3_MD5_CRYPT and PHP3_BLOWFISH_CRYPT as appropriate
for the target platform
*/
-#ifdef PHP3_STD_DES_CRYPT
+#if PHP3_STD_DES_CRYPT
#define PHP3_MAX_SALT_LEN 2
#endif
-#ifdef PHP3_EXT_DES_CRYPT
+#if PHP3_EXT_DES_CRYPT
#undef PHP3_MAX_SALT_LEN
#define PHP3_MAX_SALT_LEN 9
#endif
-#ifdef PHP3_MD5_CRYPT
+#if PHP3_MD5_CRYPT
#undef PHP3_MAX_SALT_LEN
#define PHP3_MAX_SALT_LEN 12
#endif
-#ifdef PHP3_BLOWFISH_CRYPT
+#if PHP3_BLOWFISH_CRYPT
#undef PHP3_MAX_SALT_LEN
#define PHP3_MAX_SALT_LEN 17
#endif
-#ifdef HAVE_LRAND48
+#if HAVE_LRAND48
#define PHP3_CRYPT_RAND lrand48()
#else
-#ifdef HAVE_RANDOM
+#if HAVE_RANDOM
#define PHP3_CRYPT_RAND random()
#else
#define PHP3_CRYPT_RAND rand()
@@ -103,7 +103,7 @@
#endif
int php3_minit_crypt(INIT_FUNC_ARGS) {
-#ifdef PHP3_STD_DES_CRYPT
+#if PHP3_STD_DES_CRYPT
REGISTER_LONG_CONSTANT("CRYPT_SALT_LENGTH", 2, CONST_CS | CONST_PERSISTENT);
#else
#if PHP3_MD5_CRYPT
@@ -156,17 +156,17 @@
/* The automatic salt generation only covers standard DES and md5-crypt */
if(!*salt) {
-#ifdef HAVE_SRAND48
+#if HAVE_SRAND48
srand48((unsigned int) time(0) * getpid());
#else
-#ifdef HAVE_SRANDOM
+#if HAVE_SRANDOM
srandom((unsigned int) time(0) * getpid());
#else
srand((unsigned int) time(0) * getpid());
#endif
#endif
-#ifdef PHP3_STD_DES_CRYPT
+#if PHP3_STD_DES_CRYPT
php3i_to64(&salt[0], PHP3_CRYPT_RAND, 2);
salt[2] = '\0';
#else