diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-02-28 22:50:01 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-02-28 22:50:01 +0000 |
commit | 0e1174fbb7cba4be4fa21537956dc1812bfb4b6e (patch) | |
tree | 0f7a901110a8ce2443cb1d8c09618c9e0bab4f01 /syncClientSocket.cpp | |
parent | fixed anyctroptions help (diff) |
test
Diffstat (limited to 'syncClientSocket.cpp')
-rw-r--r-- | syncClientSocket.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/syncClientSocket.cpp b/syncClientSocket.cpp index 6ef542d..9cd7bda 100644 --- a/syncClientSocket.cpp +++ b/syncClientSocket.cpp @@ -49,9 +49,10 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len) } while (iss_.good()) { + cLog.msg(Log::PRIO_NOTICE) << "string size " << iss_.str().size() << " casted size" << static_cast<int32_t>(iss_.str().size()); if(missing_chars==-1 && iss_.str().size()>5) { - char * buffer = new char [6]; + char * buffer = new char [6+1]; iss_.read(buffer,6); std::stringstream tmp; tmp.write(buffer,6); @@ -61,7 +62,7 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len) } else if(missing_chars>0 && missing_chars<=static_cast<int32_t>(iss_.str().size())) { - char * buffer = new char [missing_chars]; + char * buffer = new char [missing_chars+1]; iss_.read(buffer,missing_chars); std::stringstream tmp; tmp.write(buffer,missing_chars); |