1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

- strncpy returns the byte copied not error code or 0

This commit is contained in:
Pierre Joye
2008-08-20 13:27:10 +00:00
parent 2cde8f416a
commit 818c4d75c8
+1 -1
View File
@@ -211,7 +211,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
strcat_s(passwd, MD5_HASH_MAX_LEN, "$");
#else
/* VC6 version doesn't have strcat_s or strncpy_s */
if (strncpy(passwd + MD5_MAGIC_LEN, sp, sl + 1) != 0) {
if (strncpy(passwd + MD5_MAGIC_LEN, sp, sl + 1) < sl) {
goto _destroyCtx1;
}
strcat(passwd, "$");