Skip to content

Commit

Permalink
Fix segfault (closes #434, #435)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnErrupTion committed Dec 7, 2022
1 parent 2ffb862 commit 1915376
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/inputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ void input_desktop_add(
target->list[target->cur] = name;

int name_len = strlen(name);
char* name_simple = malloc(name_len);

memcpy(name_simple, name, name_len);
char* name_simple = strdup(name_len);

if (strstr(name_simple, " ") != NULL)
{
Expand Down

1 comment on commit 1915376

@mindsDevCom
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to bother, think it should have been:
char* name_simple = strdup(name);

Am i wrong?

Please sign in to comment.