placeholder_t: Make char*s const
Similarly to https://github.com/i3/i3status/pull/412
Orestis Floros
4 years ago
542 | 542 |
/** Helper structure for usage in format_placeholders(). */
|
543 | 543 |
typedef struct placeholder_t {
|
544 | 544 |
/* The placeholder to be replaced, e.g., "%title". */
|
545 | |
char *name;
|
|
545 |
const char *name;
|
546 | 546 |
/* The value this placeholder should be replaced with. */
|
547 | |
char *value;
|
|
547 |
const char *value;
|
548 | 548 |
} placeholder_t;
|
549 | 549 |
|
550 | 550 |
/**
|
2317 | 2317 |
char *formatted_str = format_placeholders(con->title_format, &placeholders[0], num);
|
2318 | 2318 |
i3String *formatted = i3string_from_utf8(formatted_str);
|
2319 | 2319 |
i3string_set_markup(formatted, pango_markup);
|
2320 | |
FREE(formatted_str);
|
2321 | |
|
2322 | |
for (size_t i = 0; i < num; i++) {
|
2323 | |
FREE(placeholders[i].value);
|
2324 | |
}
|
|
2320 |
|
|
2321 |
free(formatted_str);
|
|
2322 |
free(title);
|
|
2323 |
free(class);
|
|
2324 |
free(instance);
|
2325 | 2325 |
|
2326 | 2326 |
return formatted;
|
2327 | 2327 |
}
|