diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-05 12:47:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-05 12:47:07 +0000 |
commit | 8717c665cc0c324e3732a3350571069d9aecf539 (patch) | |
tree | bea28e690e42a5a687dc872fc489eb844217ad86 /plugins/NewAwaySysMod/src/SetAwayMsg.cpp | |
parent | 61b47480e829441e8411bab1ca88eef4d8882dd3 (diff) |
some useless malloc() calls removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12607 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewAwaySysMod/src/SetAwayMsg.cpp')
-rw-r--r-- | plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index c944d2fc2c..a30283fb4f 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -78,11 +78,11 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, SendMessage(hWnd, WM_KEYDOWN, VK_LEFT, 0);
SendMessage(hWnd, EM_GETSEL, (WPARAM)&start, NULL);
int nLen = GetWindowTextLength(hWnd);
- TCHAR *text = (TCHAR*)malloc((nLen + 1) * sizeof(TCHAR));
+ TCHAR *text = (TCHAR*)_alloca((nLen + 1) * sizeof(TCHAR));
GetWindowText(hWnd, text, nLen + 1);
memmove(text + start, text + end, sizeof(TCHAR)* (_tcslen(text) + 1 - end));
SetWindowText(hWnd, text);
- free(text);
+
SendMessage(hWnd, EM_SETSEL, start, start);
SendMessage(GetParent(hWnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hWnd), EN_CHANGE), (LPARAM)hWnd);
return 0;
|