diff options
Diffstat (limited to 'sway/config/output.c')
-rw-r--r-- | sway/config/output.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index ff3f73a3..f336c949 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -14,11 +14,16 @@ int output_name_cmp(const void *item, const void *data) { | |||
14 | return strcmp(output->name, name); | 14 | return strcmp(output->name, name); |
15 | } | 15 | } |
16 | 16 | ||
17 | struct output_config *new_output_config() { | 17 | struct output_config *new_output_config(const char *name) { |
18 | struct output_config *oc = calloc(1, sizeof(struct output_config)); | 18 | struct output_config *oc = calloc(1, sizeof(struct output_config)); |
19 | if (oc == NULL) { | 19 | if (oc == NULL) { |
20 | return NULL; | 20 | return NULL; |
21 | } | 21 | } |
22 | oc->name = strdup(name); | ||
23 | if (oc->name == NULL) { | ||
24 | free(oc); | ||
25 | return NULL; | ||
26 | } | ||
22 | oc->enabled = -1; | 27 | oc->enabled = -1; |
23 | oc->width = oc->height = -1; | 28 | oc->width = oc->height = -1; |
24 | oc->refresh_rate = -1; | 29 | oc->refresh_rate = -1; |