diff --git a/src/common/buf.c b/src/common/buf.c index f6667418..f6bde97f 100644 --- a/src/common/buf.c +++ b/src/common/buf.c @@ -52,7 +52,7 @@ buf_expand_shell_variables(struct buf *s) for (int i = 0 ; i < s->len ; i++) { if (s->buf[i] == '$' && isvalid(s->buf[i+1])) { /* expand environment variable */ - environment_variable.len = 0; + buf_clear(&environment_variable); buf_add(&environment_variable, s->buf + i + 1); char *p = environment_variable.buf; while (isvalid(*p)) { diff --git a/src/osd.c b/src/osd.c index d6d6be56..85e9f433 100644 --- a/src/osd.c +++ b/src/osd.c @@ -369,7 +369,7 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h, int nr_fields = wl_list_length(&rc.window_switcher.fields); struct window_switcher_field *field; wl_list_for_each(field, &rc.window_switcher.fields, link) { - buf.len = 0; + buf_clear(&buf); cairo_move_to(cairo, x, y + theme->osd_window_switcher_item_padding_y + theme->osd_window_switcher_item_active_border_width); @@ -399,8 +399,6 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h, if (wl_list_length(&server->outputs) > 1 && output_is_usable((*view)->output)) { buf_add(&buf, (*view)->output->wlr_output->name); - } else { - buf_add(&buf, " "); } break; case LAB_FIELD_IDENTIFIER: