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 | 4c29d02b631021b89253dd3f8ac0dfb9fbf73fa1 (patch) | |
| tree | eba89ff1ccaaddb0af43882b0fc36572ebb8bf09 | |
| parent | d6ac3447e11b1d9f2e6a64d463cd3abf53d4f4a8 (diff) | |
workspace_create: Don't allow NULL name
| -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(); |
