summaryrefslogtreecommitdiff
path: root/lib/Buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Buffer.cc')
-rw-r--r--lib/Buffer.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Buffer.cc b/lib/Buffer.cc
index e8335d9..83369bd 100644
--- a/lib/Buffer.cc
+++ b/lib/Buffer.cc
@@ -9,6 +9,11 @@ Buffer::~Buffer() {
free(buffer);
}
+Buffer::Buffer(const Buffer & b) : Handle(-1), buffer(0), zero(b.zero), realsiz(b.realsiz), bufsiz(b.bufsiz), ptr(b.ptr) {
+ buffer = (char *) malloc(bufsiz);
+ memcpy(buffer, b.buffer, bufsiz);
+}
+
ssize_t Buffer::write(const void *buf, size_t count) {
if (!count) {
return 0;