diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2022-07-09 14:05:04 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2022-07-09 14:05:04 -0400 |
| commit | eda0be2979cb35b3255224dfff00eac605c02d5d (patch) | |
| tree | 164925cb7446b1618308d183531b62ebea2be70a | |
| parent | 93441198ad63f8cd1a0cc1e1631ae069ce9312c1 (diff) | |
workspace_create: Don't allow NULL name
(cherry picked from commit 34933bb84350fe805d82276ea02d5732546e9993)
| -rw-r--r-- | sway/tree/workspace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 0c4e97a3..ee940466 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -56,6 +56,8 @@ struct sway_output *workspace_get_initial_output(const char *name) { struct sway_workspace *workspace_create(struct sway_output *output, const char *name) { + sway_assert(name, "NULL name given to workspace_create"); + if (output == NULL) { output = workspace_get_initial_output(name); } @@ -69,7 +71,7 @@ struct sway_workspace *workspace_create(struct sway_output *output, return NULL; } node_init(&ws->node, N_WORKSPACE, ws); - ws->name = name ? strdup(name) : NULL; + ws->name = strdup(name); ws->prev_split_layout = L_NONE; ws->layout = output_get_default_layout(output); ws->floating = create_list(); |
