diff --git a/src/cfgparse.y b/src/cfgparse.y index 7c0bf900..f41a69b0 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -313,22 +313,23 @@ workspace: TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen workspace_name { int ws_num = $3; - if (ws_num < 1 || ws_num > 10) { + if (ws_num < 1) { LOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num); } else { - workspaces[ws_num - 1].preferred_screen = sstrdup($7); + Workspace *ws = workspace_get(ws_num - 1); + ws->preferred_screen = sstrdup($7); if ($8 != NULL) - workspace_set_name(&(workspaces[ws_num - 1]), $8); + workspace_set_name(ws, $8); } } | TOKWORKSPACE WHITESPACE NUMBER workspace_name { int ws_num = $3; - if (ws_num < 1 || ws_num > 10) { + if (ws_num < 1) { LOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num); } else { if ($4 != NULL) - workspace_set_name(&(workspaces[ws_num - 1]), $4); + workspace_set_name(workspace_get(ws_num - 1), $4); } } ;