Merge pull request #4051 from orestisfl/format-placeholders
placeholder_t: Make char*s const
This commit is contained in:
commit
e58f104f1e
|
@ -543,9 +543,9 @@ int mkdirp(const char *path, mode_t mode);
|
|||
/** Helper structure for usage in format_placeholders(). */
|
||||
typedef struct placeholder_t {
|
||||
/* The placeholder to be replaced, e.g., "%title". */
|
||||
char *name;
|
||||
const char *name;
|
||||
/* The value this placeholder should be replaced with. */
|
||||
char *value;
|
||||
const char *value;
|
||||
} placeholder_t;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2318,11 +2318,11 @@ i3String *con_parse_title_format(Con *con) {
|
|||
char *formatted_str = format_placeholders(con->title_format, &placeholders[0], num);
|
||||
i3String *formatted = i3string_from_utf8(formatted_str);
|
||||
i3string_set_markup(formatted, pango_markup);
|
||||
FREE(formatted_str);
|
||||
|
||||
for (size_t i = 0; i < num; i++) {
|
||||
FREE(placeholders[i].value);
|
||||
}
|
||||
free(formatted_str);
|
||||
free(title);
|
||||
free(class);
|
||||
free(instance);
|
||||
|
||||
return formatted;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue