diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-24 23:25:58 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-24 23:25:58 +0000 |
commit | 7d7f1045fa9f97b6797ddf70b66c7b78aadc1105 (patch) | |
tree | 12679470148b109564cc28a52fa7aeb5732f5b00 /ace/Message_Block.cpp | |
parent | cfbd608bdcbfb343bb7847830cb8d332fe181d6f (diff) | |
download | ATCD-7d7f1045fa9f97b6797ddf70b66c7b78aadc1105.tar.gz |
Done
Diffstat (limited to 'ace/Message_Block.cpp')
-rw-r--r-- | ace/Message_Block.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 96e94d460ae..5c0947f806a 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -28,6 +28,24 @@ ACE_Message_Block::copy (const char *buf, size_t n) } } +int +ACE_Message_Block::copy (const char *buf) +{ + ACE_TRACE ("ACE_Message_Block::copy"); + // Note that for this to work correct, end() *must* be >= wr_ptr(). + size_t len = size_t (this->end () - this->wr_ptr ()); + size_t buflen = ACE_OS::strlen (buf) + 1; + + if (len < buflen) + return -1; + else + { + (void) ACE_OS::memcpy (this->wr_ptr (), buf, buflen); + this->wr_ptr (buflen); + return 0; + } +} + void ACE_Message_Block::dump (void) const { |