diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
| commit | fd5a0b31640419ca63d1ddeaffd6d3cf2a741814 (patch) | |
| tree | bfd17d84c5181d7b98d7d66f56573f4fc897e31c /win32/winutil.c | |
| parent | 01fcdff3849c3691d9aaeaab735846ab6d8895ca (diff) | |
| download | php-upstream/5.3.5.tar.gz | |
Imported Upstream version 5.3.5upstream/5.3.5
Diffstat (limited to 'win32/winutil.c')
| -rw-r--r-- | win32/winutil.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/win32/winutil.c b/win32/winutil.c index 0dbcddfc1..bc20f78d6 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: winutil.c 300273 2010-06-08 13:00:11Z pajoye $ */ +/* $Id: winutil.c 305778 2010-11-26 18:25:13Z pajoye $ */ #include "php.h" #include <wincrypt.h> @@ -70,13 +70,10 @@ 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 FAILURE; + return SUCCESS; + } else { + return FAILURE; + } } /* }}} */ + |
