Fixed a bug in RFC-2231 implementation.

This commit is contained in:
Vincent Richard 2005-06-21 21:13:38 +00:00
parent 7b3dd58edb
commit af45ec7216
3 changed files with 5 additions and 2 deletions

View File

@ -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 <vincent@vincent-richard.net>
* word.cpp: fixed a bug in parsing, when the first character of word data

View File

@ -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])
{

View File

@ -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 "