|
a/src/bincimapmime/mime-printbody.cc |
|
b/src/bincimapmime/mime-printbody.cc |
|
... |
|
... |
70 |
break;
|
70 |
break;
|
71 |
|
71 |
|
72 |
output << (char)c;
|
72 |
output << (char)c;
|
73 |
}
|
73 |
}
|
74 |
}
|
74 |
}
|
|
|
75 |
|
|
|
76 |
void Binc::MimePart::getBody(int fd, string &s,
|
|
|
77 |
unsigned int startoffset,
|
|
|
78 |
unsigned int length) const
|
|
|
79 |
{
|
|
|
80 |
if (!mimeSource || mimeSource->getFileDescriptor() != fd) {
|
|
|
81 |
delete mimeSource;
|
|
|
82 |
mimeSource = new MimeInputSource(fd);
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
mimeSource->reset();
|
|
|
86 |
mimeSource->seek(bodystartoffsetcrlf + startoffset);
|
|
|
87 |
|
|
|
88 |
if (startoffset + length > bodylength)
|
|
|
89 |
length = bodylength - startoffset;
|
|
|
90 |
|
|
|
91 |
char c = '\0';
|
|
|
92 |
for (unsigned int i = 0; i < length; ++i) {
|
|
|
93 |
if (!mimeSource->getChar(&c))
|
|
|
94 |
break;
|
|
|
95 |
|
|
|
96 |
s += (char)c;
|
|
|
97 |
}
|
|
|
98 |
}
|