summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-03-24 21:51:58 +0000
committerChris Wilson <chris+github@qwirx.com>2007-03-24 21:51:58 +0000
commit9a5063929192a9f47cc72420b8b33c85e3ec3627 (patch)
treee3660f4226cea4fc30f0b1adee09b774ad8a741e
parentca2ba680bb5d112eccc1a152704945d89db8c733 (diff)
Use memmove() for overlapping source and destination buffer. Thanks to
Charles Lecklider for pointing this out. (refs #3, merges [1442])
-rw-r--r--lib/server/WinNamedPipeStream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/server/WinNamedPipeStream.cpp b/lib/server/WinNamedPipeStream.cpp
index 6ef174c8..34263683 100644
--- a/lib/server/WinNamedPipeStream.cpp
+++ b/lib/server/WinNamedPipeStream.cpp
@@ -293,7 +293,7 @@ int WinNamedPipeStream::Read(void *pBuffer, int NBytes, int Timeout)
}
memcpy(pBuffer, mReadBuffer, BytesToCopy);
- memcpy(mReadBuffer, mReadBuffer + BytesToCopy, BytesRemaining);
+ memmove(mReadBuffer, mReadBuffer + BytesToCopy, BytesRemaining);
mBytesInBuffer = BytesRemaining;
NumBytesRead = BytesToCopy;