From: Pierre Joye Date: Sun, 10 Aug 2008 21:34:02 +0000 (+0000) Subject: - fix the VC6 fix or strncpy_s (md5 crypt failed with VC9 as it used strncpy wrongly) X-Git-Tag: BEFORE_HEAD_NS_CHANGE~789 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a015008b67a7155c5d3f0a13c8d68c9035e1472;p=php - fix the VC6 fix or strncpy_s (md5 crypt failed with VC9 as it used strncpy wrongly) --- diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index 7f8676a54b..99042b01a9 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -204,7 +204,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN); -#ifdef strncpy_s +#if _MSC_VER >= 1500 if (strncpy_s(passwd + MD5_MAGIC_LEN, MD5_HASH_MAX_LEN - MD5_MAGIC_LEN, sp, sl + 1) != 0) { goto _destroyCtx1; }