aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/body.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/body.cpp b/src/body.cpp
index b9180d74..88414ab6 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -141,8 +141,8 @@ void body::parse(const string& buffer, const string::size_type position,
string::size_type partEnd = pos;
// Get rid of the [CR]LF just before the boundary string
- if (pos - 1 >= position && buffer[pos - 1] == '\n') --partEnd;
- if (pos - 2 >= position && buffer[pos - 2] == '\r') --partEnd;
+ if (pos >= (position + 1) && buffer[pos - 1] == '\n') --partEnd;
+ if (pos >= (position + 2) && buffer[pos - 2] == '\r') --partEnd;
// Check whether it is the last part (boundary terminated by "--")
pos += boundarySep.length();