From 4e37f436f4425ce1c428f93bedd81bfdc4dc23f7 Mon Sep 17 00:00:00 2001 From: weidai Date: Mon, 5 Sep 2005 21:43:43 +0000 Subject: port to GCC 4 git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@211 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- osrng.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'osrng.cpp') diff --git a/osrng.cpp b/osrng.cpp index c3c4e80..3d307b4 100644 --- a/osrng.cpp +++ b/osrng.cpp @@ -126,8 +126,8 @@ void BlockingRng::GenerateBlock(byte *output, size_t size) { // on some systems /dev/random will block until all bytes // are available, on others it will returns immediately - int len = read(m_fd, output, STDMIN(size, (unsigned int)INT_MAX)); - if (len == -1) + ssize_t len = read(m_fd, output, size); + if (len < 0) throw OS_RNG_Err("read /dev/random"); size -= len; output += len; -- cgit v1.2.1