diff options
author | Pixel <Pixel> | 2002-01-10 14:15:35 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2002-01-10 14:15:35 +0000 |
commit | 53de7397c5d9cfcbf480f122a379f077345f8ba8 (patch) | |
tree | f8061c3fe184c635d2fa419ed039e0611a11063f /lib/Buffer.cc | |
parent | 692672cd414addadfe666904c10d4492a7fcbe17 (diff) |
Better duplicating handling...
Diffstat (limited to 'lib/Buffer.cc')
-rw-r--r-- | lib/Buffer.cc | 5 |
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; |