mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 16:36:26 +01:00
swaybar: fix array indices in i3json_handle
This commit is contained in:
parent
ac23fa5f20
commit
b66c51ea2c
1 changed files with 6 additions and 6 deletions
|
@ -425,9 +425,9 @@ void render() {
|
||||||
cairo_set_source_u32(window->cairo, colors.separator);
|
cairo_set_source_u32(window->cairo, colors.separator);
|
||||||
cairo_set_line_width(window->cairo, 1);
|
cairo_set_line_width(window->cairo, 1);
|
||||||
cairo_move_to(window->cairo, blockpos + width
|
cairo_move_to(window->cairo, blockpos + width
|
||||||
+ block->separator_block_width/2, margin);
|
+ block->separator_block_width/2, margin);
|
||||||
cairo_line_to(window->cairo, blockpos + width
|
cairo_line_to(window->cairo, blockpos + width
|
||||||
+ block->separator_block_width/2, window->height - margin);
|
+ block->separator_block_width/2, window->height - margin);
|
||||||
cairo_stroke(window->cairo);
|
cairo_stroke(window->cairo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -659,11 +659,11 @@ int i3json_handle(FILE *file) {
|
||||||
}
|
}
|
||||||
--i3json_state.depth;
|
--i3json_state.depth;
|
||||||
if (i3json_state.depth == 1) {
|
if (i3json_state.depth == 1) {
|
||||||
ssize_t len = c-i3json_state.line_start+1;
|
// c[1] is valid since c[0] != '\0'
|
||||||
char p = c[len];
|
char p = c[1];
|
||||||
c[len] = '\0';
|
c[1] = '\0';
|
||||||
parse_json(i3json_state.line_start);
|
parse_json(i3json_state.line_start);
|
||||||
c[len] = p;
|
c[1] = p;
|
||||||
++handled;
|
++handled;
|
||||||
i3json_state.line_start = c+1;
|
i3json_state.line_start = c+1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue