summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-07-14 21:32:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-07-14 21:32:30 +0300
commit149282db31fd9b6be2142d21cac98bae97ce9a4d (patch)
tree491b25d7aeab6440307d3a00aa74fec6b0f75e46 /src/mir_app
parentf1cfa0c2d6fd7d03c657b2ccb2baeaaa6f91e283 (diff)
fixes #2421 (Список контактов не отображает группы с длинными наименованиями)
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/clistgroups.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp
index 4a308edb28..9040e2b048 100644
--- a/src/mir_app/src/clistgroups.cpp
+++ b/src/mir_app/src/clistgroups.cpp
@@ -25,12 +25,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "clc.h"
+#define MAX_GROUPNAME_LEN 256
+
struct CGroupInternal
{
CGroupInternal(int _id, const wchar_t *_name) :
groupId(_id),
groupName(mir_wstrdup(_name))
- {}
+ {}
~CGroupInternal()
{ mir_free(groupName);
@@ -103,7 +105,7 @@ MIR_APP_DLL(MGROUP) Clist_GroupExists(LPCTSTR ptszGroupName)
static INT_PTR CreateGroupInternal(MGROUP hParent, const wchar_t *ptszName)
{
- wchar_t newBaseName[127], newName[128];
+ wchar_t newBaseName[MAX_GROUPNAME_LEN-1], newName[MAX_GROUPNAME_LEN];
const wchar_t *grpName = ptszName ? ptszName : TranslateT("New group");
if (hParent) {
@@ -461,7 +463,7 @@ MIR_APP_DLL(HMENU) Clist_GroupBuildMenu()
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- wchar_t szThisField[128], szThisMenuItem[128];
+ wchar_t szThisField[MAX_GROUPNAME_LEN], szThisMenuItem[MAX_GROUPNAME_LEN];
do {
const wchar_t *pBackslash = wcschr(pNextField, '\\');
if (pBackslash == nullptr) {