Thomas Weidenmueller wrote:
@@ -135,16 +141,16 @@ SL_ITEM_TYPE type, PDOC_ITEM LastItem) { PDOC_ITEM Item;
- Item = Alloc(sizeof(DOC_ITEM) + ((textlen + 1) * sizeof(WCHAR)));
- textlen = min(textlen, lstrlenW(Text));
- Item = Alloc(FIELD_OFFSET(DOC_ITEM, Text[0]) + ((textlen + 1) * sizeof(WCHAR)));
This line can be written simpler as:
Item = Alloc(FIELD_OFFSET(DOC_ITEM, Text[textlen + 1]));