summaryrefslogtreecommitdiff
path: root/new/util_windows.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-07 23:40:18 -0400
committerPietro Gagliardi <[email protected]>2015-04-07 23:40:18 -0400
commit66788e6edb8a7e59f5676ca8cf928e23583cb31a (patch)
tree6bdd493db0e67363779f745d48a872d1967d76bc /new/util_windows.c
parent49ee58ca364d055594657f11cef04f8c8440c366 (diff)
Implemented the memory logging.
Diffstat (limited to 'new/util_windows.c')
-rw-r--r--new/util_windows.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/new/util_windows.c b/new/util_windows.c
index 8e0532b..4f883b9 100644
--- a/new/util_windows.c
+++ b/new/util_windows.c
@@ -11,7 +11,7 @@ WCHAR *toUTF16(const char *str)
n = MBTWC(str, NULL, 0);
if (n == 0)
logLastError("error figuring out number of characters to convert to in toUTF16()");
- wstr = (WCHAR *) uiAlloc(n * sizeof (WCHAR));
+ wstr = (WCHAR *) uiAlloc(n * sizeof (WCHAR), "WCHAR[]");
if (MBTWC(str, wstr, n) != n)
logLastError("error converting from UTF-8 to UTF-16 in toUTF16()");
return wstr;
@@ -30,7 +30,7 @@ intmax_t uiWindowsWindowTextWidth(HWND hwnd)
len = GetWindowTextLengthW(hwnd);
if (len == 0) // no text; nothing to do
return 0;
- text = (WCHAR *) uiAlloc((len + 1) * sizeof (WCHAR));
+ text = (WCHAR *) uiAlloc((len + 1) * sizeof (WCHAR), "WCHAR[]");
if (GetWindowText(hwnd, text, len + 1) == 0) // should only happen on error given explicit test for len == 0 above
logLastError("error getting window text in uiWindowsWindowTextWidth()");
dc = GetDC(hwnd);