[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:03:27 UTC 2012
The following commit has been merged in the wheezy branch:
commit 322096bb3722a9421db96ed6f9a4996cc42fb073
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Thu Apr 26 23:51:08 2012 -0300
regedit: Fix item text reading in regedit.
(cherry picked from commit c3821f6c6389e8087a916b6a313d94c39e08abf5)
diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c
index bbd5dd6..6559116 100644
--- a/programs/regedit/listview.c
+++ b/programs/regedit/listview.c
@@ -58,20 +58,17 @@ LPWSTR GetItemText(HWND hwndLV, UINT item)
{
LPWSTR newStr, curStr;
unsigned int maxLen = 128;
+ if (item == 0) return NULL; /* first item is ALWAYS a default */
curStr = HeapAlloc(GetProcessHeap(), 0, maxLen * sizeof(WCHAR));
if (!curStr) return NULL;
- if (item == 0) { /* first item is ALWAYS a default */
- HeapFree(GetProcessHeap(), 0, curStr);
- return NULL;
- }
do {
- ListView_GetItemTextW(hwndLV, item, 0, curStr, maxLen * sizeof(WCHAR));
+ ListView_GetItemTextW(hwndLV, item, 0, curStr, maxLen);
if (lstrlenW(curStr) < maxLen - 1) return curStr;
- newStr = HeapReAlloc(GetProcessHeap(), 0, curStr, maxLen * 2 * sizeof(WCHAR));
+ maxLen *= 2;
+ newStr = HeapReAlloc(GetProcessHeap(), 0, curStr, maxLen * sizeof(WCHAR));
if (!newStr) break;
curStr = newStr;
- maxLen *= 2;
} while (TRUE);
HeapFree(GetProcessHeap(), 0, curStr);
return NULL;
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list