From 53de7397c5d9cfcbf480f122a379f077345f8ba8 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 10 Jan 2002 14:15:35 +0000 Subject: Better duplicating handling... --- lib/Buffer.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Buffer.cc') 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; -- cgit v1.2.3