mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
improve condition
read() == 0 is EOL
This commit is contained in:
parent
1a2c5bc180
commit
cbcacbb2da
@ -104,7 +104,7 @@ static int php_random_bytes(void *bytes, size_t size)
|
||||
|
||||
while (read_bytes < size) {
|
||||
ssize_t n = read(fd, bytes + read_bytes, size - read_bytes);
|
||||
if (n < 0) {
|
||||
if (n <= 0) {
|
||||
break;
|
||||
}
|
||||
read_bytes += n;
|
||||
|
Loading…
Reference in New Issue
Block a user