commit bac65078a28323ced0d25d7decea783c157028d4
parent 07b6be62144f84539b97ce9d41e9a6c5792deb54
Author: Ryan Dwyer <ryandwyer1@gmail.com>
Date: Mon, 9 Apr 2018 17:25:39 +1000
Fix buffer issues in swaybar status line.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c
@@ -125,9 +125,12 @@ bool i3bar_handle_readable(struct status_line *status) {
status_error(status, "[failed to allocate buffer]");
return -1;
}
+ state->current_node += new_buffer - state->buffer;
+ cur += new_buffer - state->buffer;
state->buffer = new_buffer;
}
+ cur[n] = '\0';
bool redraw = false;
while (*cur) {
if (state->nodes[state->depth] == JSON_NODE_STRING) {