Permalink
Browse files

Fix CChan::TrimBuffer() (#63)

CChan::TrimBuffer() was trying to do "m_vsBuffer.begin() + -<some number>" which would cause a segmentation fault

Fixes #63
  • Loading branch information...
1 parent b6903fd commit ebab5599312a4538657d9f8a3e17c6c79abe2c33 @kylef kylef committed with psychon Sep 4, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Chan.cpp
View
@@ -538,7 +538,7 @@ void CChan::ClearBuffer() {
void CChan::TrimBuffer(const unsigned int uMax) {
if (m_vsBuffer.size() > uMax) {
- m_vsBuffer.erase(m_vsBuffer.begin(), m_vsBuffer.begin() + (uMax - m_vsBuffer.size()));
+ m_vsBuffer.erase(m_vsBuffer.begin(), m_vsBuffer.begin() + (m_vsBuffer.size() - uMax));
}
}

0 comments on commit ebab559

Please sign in to comment.