summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/Buffer.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/node/Buffer.hpp b/node/Buffer.hpp
index ed463bf6..14dd05c3 100644
--- a/node/Buffer.hpp
+++ b/node/Buffer.hpp
@@ -124,7 +124,7 @@ public:
{
if (b._l > C)
throw std::out_of_range("Buffer: assignment from buffer larger than capacity");
- memcpy(this,&b,sizeof(_l) + b._l); // one memcpy for all fields
+ memcpy(_b,b._b,_l = b._l);
return *this;
}
@@ -358,6 +358,15 @@ public:
}
/**
+ * Unconditionally zero buffer's underlying memory
+ */
+ inline void zeroAll()
+ throw()
+ {
+ memset(_b,0,sizeof(_b));
+ }
+
+ /**
* @return Size of data in buffer
*/
inline unsigned int size() const throw() { return _l; }