]> granicus.if.org Git - php/commitdiff
- fix the VC6 fix or strncpy_s (md5 crypt failed with VC9 as it used strncpy wrongly)
authorPierre Joye <pajoye@php.net>
Sun, 10 Aug 2008 21:34:02 +0000 (21:34 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 10 Aug 2008 21:34:02 +0000 (21:34 +0000)
ext/standard/php_crypt_r.c

index 7f8676a54b0ed2fa83a19e34afc9323faf63e614..99042b01a95b5961cd6ce24be512109a05f41647 100644 (file)
@@ -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;
        }