From 1d0175a29e1b82801e5ed0c9a4aba5f76cc52629 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 18 Feb 2008 17:13:20 +0000 Subject: [PATCH] 2008-02-19 Tatsuhiro Tsujikawa * src/MSEHandshake.cc (encryptAndSendData): Use std::min(). --- ChangeLog | 4 ++++ src/MSEHandshake.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5391c84c..a4607335 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-19 Tatsuhiro Tsujikawa + + * src/MSEHandshake.cc (encryptAndSendData): Use std::min(). + 2008-02-19 Tatsuhiro Tsujikawa Determin _threadtholdSpeed in each constructor for diff --git a/src/MSEHandshake.cc b/src/MSEHandshake.cc index 79799033..49facca2 100644 --- a/src/MSEHandshake.cc +++ b/src/MSEHandshake.cc @@ -196,7 +196,7 @@ void MSEHandshake::encryptAndSendData(const unsigned char* data, size_t length) size_t s; size_t r = length; while(r > 0) { - s = r > sizeof(temp)?sizeof(temp):r; + s = std::min(r, sizeof(temp)); _encryptor->encrypt(temp, s, dptr, s); _socket->writeData(temp, s); dptr += s;