summaryrefslogtreecommitdiff
path: root/queue.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-06-19 17:09:07 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-06-19 17:09:07 +0000
commitab1ed4b45d7c6ea11785065027986d389e5b673a (patch)
tree7e300cb2827b1bf3cc05695e5e89b5ef58b1be93 /queue.cpp
parentb0034a8989f961db2fcfb7673e487031e3115cb5 (diff)
downloadcryptopp-ab1ed4b45d7c6ea11785065027986d389e5b673a.tar.gz
sync with private branch
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@81 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'queue.cpp')
-rw-r--r--queue.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/queue.cpp b/queue.cpp
index 976bb0c..16de772 100644
--- a/queue.cpp
+++ b/queue.cpp
@@ -234,9 +234,15 @@ void ByteQueue::LazyPut(const byte *inString, unsigned int size)
{
if (m_lazyLength > 0)
FinalizeLazyPut();
- m_lazyString = const_cast<byte *>(inString);
- m_lazyLength = size;
- m_lazyStringModifiable = false;
+
+ if (inString == m_tail->buf+m_tail->m_tail)
+ Put(inString, size);
+ else
+ {
+ m_lazyString = const_cast<byte *>(inString);
+ m_lazyLength = size;
+ m_lazyStringModifiable = false;
+ }
}
void ByteQueue::LazyPutModifiable(byte *inString, unsigned int size)