Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1735 from shdown/strdup
Browse files Browse the repository at this point in the history
i3bar: fix freeing static strings
  • Loading branch information
stapelberg committed Jun 2, 2015
2 parents 6b505d8 + fe006f0 commit 7b8745f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions i3bar/src/child.c
Expand Up @@ -107,14 +107,14 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha

struct status_block *err_block = scalloc(sizeof(struct status_block));
err_block->full_text = i3string_from_utf8("Error: ");
err_block->name = "error";
err_block->color = "red";
err_block->name = sstrdup("error");
err_block->color = sstrdup("red");
err_block->no_separator = true;

struct status_block *message_block = scalloc(sizeof(struct status_block));
message_block->full_text = i3string_from_utf8(message);
message_block->name = "error_message";
message_block->color = "red";
message_block->name = sstrdup("error_message");
message_block->color = sstrdup("red");
message_block->no_separator = true;

TAILQ_INSERT_HEAD(&statusline_head, err_block, blocks);
Expand Down

0 comments on commit 7b8745f

Please sign in to comment.