diff options
Diffstat (limited to 'swaynag/config.c')
-rw-r--r-- | swaynag/config.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/swaynag/config.c b/swaynag/config.c index fb2aa820..2fa7cb61 100644 --- a/swaynag/config.c +++ b/swaynag/config.c | |||
@@ -332,9 +332,7 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) { | |||
332 | return 0; | 332 | return 0; |
333 | } | 333 | } |
334 | 334 | ||
335 | struct swaynag_type *type; | 335 | struct swaynag_type *type = swaynag_type_new("<config>"); |
336 | type = calloc(1, sizeof(struct swaynag_type)); | ||
337 | type->name = strdup("<config>"); | ||
338 | list_add(types, type); | 336 | list_add(types, type); |
339 | 337 | ||
340 | char *line = NULL; | 338 | char *line = NULL; |
@@ -364,8 +362,7 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) { | |||
364 | strncat(name, line + 1, close - line - 1); | 362 | strncat(name, line + 1, close - line - 1); |
365 | type = swaynag_type_get(types, name); | 363 | type = swaynag_type_get(types, name); |
366 | if (!type) { | 364 | if (!type) { |
367 | type = calloc(1, sizeof(struct swaynag_type)); | 365 | type = swaynag_type_new(name); |
368 | type->name = strdup(name); | ||
369 | list_add(types, type); | 366 | list_add(types, type); |
370 | } | 367 | } |
371 | free(name); | 368 | free(name); |