diff options
author | Pixel <Pixel> | 2001-11-15 14:52:43 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-11-15 14:52:43 +0000 |
commit | 3f720784d55707024fff675a5238fde0168d1a40 (patch) | |
tree | 84a5b9843ede69aaf76cd9b791686b2a3ea7c3d7 /lib/Buffer.cc | |
parent | 8694409f2a5531e9f3263e8a42248a3ca91ac14f (diff) |
More work into TaskMan...
Diffstat (limited to 'lib/Buffer.cc')
-rw-r--r-- | lib/Buffer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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; |