diff options
author | Vincent Richard <[email protected]> | 2005-09-16 11:05:31 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-09-16 11:05:31 +0000 |
commit | e51fb0c931ad6828add844af4c7e6080bc8175b0 (patch) | |
tree | 4b9118d3b6d1c4b5ea483580d12bc2a6b265943e | |
parent | Non-blocking socket input/output. (diff) | |
download | vmime-e51fb0c931ad6828add844af4c7e6080bc8175b0.tar.gz vmime-e51fb0c931ad6828add844af4c7e6080bc8175b0.zip |
Input buffer size.
Diffstat (limited to '')
-rw-r--r-- | src/charset.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/charset.cpp b/src/charset.cpp index 9c0a2621..fd607fab 100644 --- a/src/charset.cpp +++ b/src/charset.cpp @@ -29,6 +29,7 @@ extern "C" #ifndef VMIME_BUILDING_DOC #include <iconv.h> + #include <errno.h> // HACK: prototypes may differ depending on the compiler and/or system (the // second parameter may or may not be 'const'). This redeclaration is a hack @@ -103,7 +104,7 @@ void charset::convert(utility::inputStream& in, utility::outputStream& out, if (cd != reinterpret_cast <iconv_t>(-1)) { - char inBuffer[5]; + char inBuffer[32768]; char outBuffer[32768]; size_t inPos = 0; @@ -146,7 +147,8 @@ void charset::convert(utility::inputStream& in, utility::outputStream& out, std::copy(const_cast <char*>(inPtr), inBuffer + sizeof(inBuffer), inBuffer); inPos = inLength; - prevIsInvalid = true; + if (errno != E2BIG) + prevIsInvalid = true; } } else |