diff options
| author | Vincent Richard <[email protected]> | 2005-06-21 23:13:38 +0200 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2005-06-21 23:13:38 +0200 |
| commit | af45ec72160d263f9b35d5ad61cf38c4816ffcc3 (patch) | |
| tree | d29fab0efbd49fa32732b02cb8a4ed0be6b4452c | |
| parent | Fixed compilation errors with g++ 4.0. (diff) | |
| download | vmime-af45ec72160d263f9b35d5ad61cf38c4816ffcc3.tar.gz vmime-af45ec72160d263f9b35d5ad61cf38c4816ffcc3.zip | |
Fixed a bug in RFC-2231 implementation.
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | src/defaultParameter.cpp | 2 | ||||
| -rw-r--r-- | tests/parser/parameterTest.cpp | 3 |
3 files changed, 5 insertions, 2 deletions
@@ -6,6 +6,8 @@ VERSION 0.7.1cvs * Fixed compilation errors with g++ 4.0. + * defaultParameter.cpp: fixed a bug in RFC-2231 implementation. + 2005-06-13 Vincent Richard <[email protected]> * word.cpp: fixed a bug in parsing, when the first character of word data diff --git a/src/defaultParameter.cpp b/src/defaultParameter.cpp index d2110be2..3a70eb72 100644 --- a/src/defaultParameter.cpp +++ b/src/defaultParameter.cpp @@ -200,7 +200,7 @@ void defaultParameter::generate(utility::outputStream& os, const string::size_ty bool needQuoting = false; string::size_type valueLength = 0; - for (string::size_type i = 0 ; (i < value.length()) && (pos < maxLineLength - 4) ; ++i, ++valueLength) + for (string::size_type i = 0 ; (i < value.length()) && (pos + valueLength < maxLineLength - 4) ; ++i, ++valueLength) { switch (value[i]) { diff --git a/tests/parser/parameterTest.cpp b/tests/parser/parameterTest.cpp index 4ce58210..82d784cd 100644 --- a/tests/parser/parameterTest.cpp +++ b/tests/parser/parameterTest.cpp @@ -221,7 +221,8 @@ namespace vmime::word("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", vmime::charset("charset")))); - assert_eq("4", "F: X; param1=abcdefgh;\r\n " + assert_eq("4", "F: X; \r\n " + "param1=abcdefghijklm;\r\n " "param1*0*=charset''abc;\r\n " "param1*1*=defghijkl;\r\n " "param1*2*=mnopqrstu;\r\n " |
