summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-26 22:50:52 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-26 22:50:52 +0000
commit6a320c380e50fe9b8af1a976e5cb54ad2398db9e (patch)
tree449b6ce6de5efdbe72cb105dae4e0102f87b2865 /src/socket.cpp
parentf96c0c9ec530da99de00a1f60052d8c0d7b19dea (diff)
Fixes for valgrind
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3355 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index fe6516bb5..1db915e4a 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -259,19 +259,20 @@ int InspSocket::Write(std::string data)
void InspSocket::FlushWriteBuffer()
{
int result = 0;
- if (this->Buffer.length())
+ const char* n = this->Buffer.c_str();
+ int v = this->Buffer.length();
+ if (v > 0)
{
- result = send(this->fd,this->Buffer.c_str(),this->Buffer.length(),0);
+ result = send(this->fd,n,v,0);
if (result > 0)
{
- if (result == (int)this->Buffer.length())
+ if (result == v)
{
this->Buffer = "";
}
else
{
/* If we wrote some, advance the buffer forwards */
- char* n = (char*)this->Buffer.c_str();
n += result;
this->Buffer = n;
}