Changeset 335 for trunk/src/gui/kernel
- Timestamp:
- Nov 20, 2009, 10:55:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qmime_pm.cpp
r334 r335 176 176 return 0; 177 177 } 178 179 180 178 181 // get the size rounded to the page boundary (4K) 179 182 ULONG sz = ~0, flags = 0; … … 189 192 // store the exact size to the last dword of the last page 190 193 *(((ULONG *)(data + sz)) - 1) = size; 194 191 195 192 196 return data; … … 388 392 QByteArray str = mimeData->text().toLocal8Bit(); 389 393 // Anticipate required space for CRLFs at 1/40 390 int maxsize = str.size()+str.size()/40+ 3;394 int maxsize = str.size()+str.size()/40+; 391 395 r.fill('\0', maxsize); 392 396 char *o = r.data(); … … 407 411 } 408 412 o[j++] = c; 409 if (j+ 3>= maxsize) {413 if (j+ >= maxsize) { 410 414 maxsize += maxsize/4; 411 415 r.resize(maxsize); … … 413 417 } 414 418 } 415 o[j] = 0; 419 if (j < r.size()) 420 o[j] = '\0'; 416 421 } else if (format == CF_TextUnicode) { 417 422 QString str = mimeData->text();
Note:
See TracChangeset
for help on using the changeset viewer.