summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}
/* }}} */