summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-08-09 08:14:14 +0000
committerPierre Joye <pajoye@php.net>2010-08-09 08:14:14 +0000
commitcf7d0fb4e78982dd274cc94a57810f88de18d128 (patch)
tree491000f87d54b819c13c0d0bbe865f3c77e18414 /win32
parent1e26362d4b03e1670e2ffd0b136db5d90570d3c3 (diff)
downloadphp-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.c10
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;
}
/* }}} */