MFB: Use reantrant crypt_r() whenever possible.

This commit is contained in:
Ilia Alshanetsky 2006-11-30 16:00:05 +00:00
parent 55ebcb9f7e
commit 053747b512

View File

@ -145,8 +145,15 @@ PHP_FUNCTION(crypt)
salt[2] = '\0'; salt[2] = '\0';
#endif #endif
} }
#ifdef HAVE_CRYPT_R
RETVAL_STRING(crypt(str, salt), 1); {
struct crypt_data buffer;
memset(&buffer, 0, sizeof(buffer));
RETURN_STRING(crypt_r(str, salt, &buffer));
}
#else
RETURN_STRING(crypt(str, salt), 1);
#endif
} }
/* }}} */ /* }}} */
#endif #endif