From: Pierre Joye Date: Mon, 9 Aug 2010 08:14:14 +0000 (+0000) Subject: - #52523, fix logic (0 is perfectly valid as part of the data, bin data) X-Git-Tag: php-5.3.4RC1~379 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf7d0fb4e78982dd274cc94a57810f88de18d128;p=php - #52523, fix logic (0 is perfectly valid as part of the data, bin data) --- diff --git a/win32/winutil.c b/win32/winutil.c index 3fc2955ff8..b310ad9614 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -70,13 +70,9 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ ret = CryptGenRandom(hCryptProv, size, buf); CryptReleaseContext(hCryptProv, 0); if (ret) { - while (i < size && buf[i] != 0) { - i++; - } - if (i == size) { - return SUCCESS; - } + return SUCCESS; + } else { + return FAILURE; } - return FAILURE; } /* }}} */