git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@368 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
Nishi 2025-10-16 12:07:47 +00:00
commit d496403c6a
4 changed files with 7 additions and 15 deletions

View file

@ -248,8 +248,7 @@ void MwListBoxInsert(MwWidget handle, int index, const char* text, MwLLPixmap pi
MwListBox lb = handle->internal;
MwListBoxEntry entry;
entry.name = malloc(strlen(text) + 1);
strcpy(entry.name, text);
entry.name = MwStringDupliacte(text);
entry.pixmap = pixmap;
@ -272,8 +271,7 @@ void MwListBoxInsertMultiple(MwWidget handle, int index, char** text, MwLLPixmap
for(i = 0; i < count; i++) {
MwListBoxEntry entry;
entry.name = malloc(strlen(text[i]) + 1);
strcpy(entry.name, text[i]);
entry.name = MwStringDupliacte(text[i]);
entry.pixmap = NULL;
if(pixmap != NULL) entry.pixmap = pixmap[i];

View file

@ -193,13 +193,11 @@ MwClass MwMenuClass = &MwMenuClassRec;
MwMenu MwMenuAdd(MwWidget handle, MwMenu menu, const char* name) {
MwMenu m = menu == NULL ? handle->internal : menu;
MwMenu new = malloc(sizeof(*new));
new->name = malloc(strlen(name) + 1);
new->name = MwStringDupliacte(name);
new->sub = NULL;
new->wsub = NULL;
new->keep = 0;
strcpy(new->name, name);
arrput(m->sub, new);
set_xywh(handle);