summaryrefslogtreecommitdiff
path: root/osrng.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-09-05 21:43:43 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-09-05 21:43:43 +0000
commit4e37f436f4425ce1c428f93bedd81bfdc4dc23f7 (patch)
tree7c9380467a43a9fd9b4095024796ccabfdce1280 /osrng.cpp
parent25699d1dcc22ac8aaa36d285e02959962e1b502c (diff)
downloadcryptopp-4e37f436f4425ce1c428f93bedd81bfdc4dc23f7.tar.gz
port to GCC 4
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@211 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'osrng.cpp')
-rw-r--r--osrng.cpp4
1 files changed, 2 insertions, 2 deletions
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;