improve condition

read() == 0 is EOL
This commit is contained in:
Anatol Belski 2015-08-12 10:20:26 +02:00
parent 1a2c5bc180
commit cbcacbb2da

View File

@ -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;