diff options
author | Pierre Joye <pajoye@php.net> | 2010-08-09 08:14:14 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2010-08-09 08:14:14 +0000 |
commit | cf7d0fb4e78982dd274cc94a57810f88de18d128 (patch) | |
tree | 491000f87d54b819c13c0d0bbe865f3c77e18414 /win32 | |
parent | 1e26362d4b03e1670e2ffd0b136db5d90570d3c3 (diff) | |
download | php-git-cf7d0fb4e78982dd274cc94a57810f88de18d128.tar.gz |
- #52523, fix logic (0 is perfectly valid as part of the data, bin data)
Diffstat (limited to 'win32')
-rw-r--r-- | win32/winutil.c | 10 |
1 files changed, 3 insertions, 7 deletions
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; } /* }}} */ |