sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 34933bb84350fe805d82276ea02d5732546e9993
parent fdde67405e8ae2e493f63e590f6b481bf981fd43
Author: Alexander Orzechowski <orzechowski.alexander@gmail.com>
Date:   Sat,  9 Jul 2022 14:05:04 -0400

workspace_create: Don't allow NULL name

Diffstat:
Msway/tree/workspace.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 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();