Add examples.
[novacoin.git] / src / serialize.h
index f579c58..52328c3 100644 (file)
@@ -1106,10 +1106,7 @@ public:
         if (nReadPosNext >= vch.size())
         {
             if (nReadPosNext > vch.size())
-            {
                 setstate(std::ios::failbit, "CDataStream::ignore() : end of data");
-                nSize = (int)(vch.size() - nReadPos);
-            }
             nReadPos = 0;
             vch.clear();
             return (*this);
@@ -1360,9 +1357,9 @@ public:
             unsigned int pos = (unsigned int)(nReadPos % vchBuf.size());
             size_t nNow = nSize;
             if (nNow + pos > vchBuf.size())
-                nNow = vchBuf.size() - pos;
+                nNow = (size_t)(vchBuf.size() - pos);
             if (nNow + nReadPos > nSrcPos)
-                nNow = nSrcPos - nReadPos;
+                nNow = (size_t)(nSrcPos - nReadPos);
             memcpy(pch, &vchBuf[pos], nNow);
             nReadPos += nNow;
             pch += nNow;