From 3f720784d55707024fff675a5238fde0168d1a40 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 15 Nov 2001 14:52:43 +0000 Subject: More work into TaskMan... --- lib/Buffer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Buffer.cc') diff --git a/lib/Buffer.cc b/lib/Buffer.cc index 6d0317e..123cc65 100644 --- a/lib/Buffer.cc +++ b/lib/Buffer.cc @@ -3,7 +3,7 @@ #include "General.h" #include "config.h" -Buffer::Buffer() : Handle(-1), buffer(NULL), realsiz(0), bufsiz(0), ptr(0) { } +Buffer::Buffer() : Handle(-1), buffer(0), realsiz(0), bufsiz(0), ptr(0) { } Buffer::~Buffer() { free(buffer); @@ -21,13 +21,13 @@ ssize_t Buffer::write(const void *buf, size_t count) { return count; } -ssize_t Buffer::read(void *buf, size_t count) { +ssize_t Buffer::read(void *buf, size_t count) throw (GeneralException) { count = MIN(count, realsiz - ptr); - + if (!count) { return 0; } - + memcpy(buf, buffer + ptr, count); ptr += count; -- cgit v1.2.3