diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-22 23:01:50 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-22 23:01:50 +0000 |
commit | a6f52d5d593a0ebe16326b04df367ede82c9511e (patch) | |
tree | ccca9a25c712b7e7b26e9b03679f6743b5e5f3a9 /lib/common/IOStream.cpp | |
parent | 484f593e08c25f5d974ff2070558a027aa5132bb (diff) |
Replace Write(const char *) with Write(const std::string&).
This is better for C++ style and potential missing null termination.
Diffstat (limited to 'lib/common/IOStream.cpp')
-rw-r--r-- | lib/common/IOStream.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/common/IOStream.cpp b/lib/common/IOStream.cpp index 35219549..98b42943 100644 --- a/lib/common/IOStream.cpp +++ b/lib/common/IOStream.cpp @@ -249,13 +249,13 @@ void IOStream::Flush(int Timeout) // // Function // Name: IOStream::Write -// Purpose: Convenience method for writing a null-terminated -// C string to a protocol buffer. +// Purpose: Convenience method for writing a C++ string to a +// protocol buffer. // // -------------------------------------------------------------------------- -void IOStream::Write(const char *pBuffer) +void IOStream::Write(const std::string& rBuffer, int Timeout) { - Write(pBuffer, strlen(pBuffer)); + Write(rBuffer.c_str(), rBuffer.size(), Timeout); } // -------------------------------------------------------------------------- |