aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-06-21 21:13:38 +0000
committerVincent Richard <[email protected]>2005-06-21 21:13:38 +0000
commitaf45ec72160d263f9b35d5ad61cf38c4816ffcc3 (patch)
treed29fab0efbd49fa32732b02cb8a4ed0be6b4452c
parentFixed compilation errors with g++ 4.0. (diff)
downloadvmime-af45ec72160d263f9b35d5ad61cf38c4816ffcc3.tar.gz
vmime-af45ec72160d263f9b35d5ad61cf38c4816ffcc3.zip
Fixed a bug in RFC-2231 implementation.
Diffstat (limited to '')
-rw-r--r--ChangeLog2
-rw-r--r--src/defaultParameter.cpp2
-rw-r--r--tests/parser/parameterTest.cpp3
3 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 44777393..c369cf9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 "