diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
commit | df247efec654e512242e4f4f1b0212034f9e01fe (patch) | |
tree | 25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/wlib/mswlib/mswmenu.c | |
parent | d0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff) | |
parent | a5ade52caa489cf0a713e0f02b764000d203140e (diff) |
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterdebian/1%5.2.0Beta2.1-1
Diffstat (limited to 'app/wlib/mswlib/mswmenu.c')
-rw-r--r-- | app/wlib/mswlib/mswmenu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/wlib/mswlib/mswmenu.c b/app/wlib/mswlib/mswmenu.c index 815752a..d56e24d 100644 --- a/app/wlib/mswlib/mswmenu.c +++ b/app/wlib/mswlib/mswmenu.c @@ -31,6 +31,7 @@ #include <math.h> #include <ctype.h> #include <assert.h> +#include "misc.h" #include "mswint.h" #include "i18n.h" @@ -579,7 +580,7 @@ wMenuPush_p wMenuPushCreate( { wMenuPush_p mi; int rc; - char label[80]; + char *label = malloc(strlen(labelStr) + 30 ); /**< The label and sufficient space for the keyboard shortcut */ char *cp; char ac; UINT vk; @@ -591,9 +592,9 @@ wMenuPush_p wMenuPushCreate( mi->mparent = m; mi->acclKey = acclKey; mi->enabled = TRUE; - strcpy( label, mi->labelStr ); + strcpy(label, labelStr); modifier = 0; - if ( acclKey != 0 ) { + if ( acclKey != 0 && strlen(label ) < 60 ) { DYNARR_APPEND( acclTable_t, acclTable_da, 10 ); cp = label + strlen( label ); *cp++ = '\t'; @@ -625,6 +626,7 @@ wMenuPush_p wMenuPushCreate( acclTable(acclTable_da.cnt-1).mp = mi; } rc = AppendMenu( m->menu, MF_STRING, mi->index, label ); + free(label); return mi; } |