diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-04-10 16:31:37 +0200 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-04-10 16:31:37 +0200 |
commit | 5b323d2cd5fc711229f9acef46b1b4f9a9c2378a (patch) | |
tree | 9b00b9d91bbe79266d2388b8ad0b0ae6e4ed6176 /src | |
parent | a31ee19ed7861dae004451df2c1cea84c45092ed (diff) | |
download | ratpoison-5b323d2cd5fc711229f9acef46b1b4f9a9c2378a.zip |
free_bar: make this function reusable
* set last_msg to NULL after freeing it
* no need to test for last_msg being NULL before freeing it
(likewise in update_last_message)
Diffstat (limited to 'src')
-rw-r--r-- | src/bar.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -531,8 +531,7 @@ draw_mark (rp_screen *s, char *msg, int mark_start, int mark_end) static void update_last_message (char *msg, int mark_start, int mark_end) { - if (last_msg) - free (last_msg); + free (last_msg); last_msg = xstrdup (msg); last_mark_start = mark_start; last_mark_end = mark_end; @@ -603,6 +602,6 @@ show_last_message (void) void free_bar (void) { - if (last_msg) - free (last_msg); + free (last_msg); + last_msg = NULL; } |