diff --git a/control.c b/control.c index 6b7c3b26..b88072d3 100644 --- a/control.c +++ b/control.c @@ -846,9 +846,9 @@ control_stop(struct client *c) if (evtimer_initialized(&cs->subs_timer)) evtimer_del(&cs->subs_timer); + control_reset_offsets(c); TAILQ_FOREACH_SAFE(cb, &cs->all_blocks, all_entry, cb1) control_free_block(cs, cb); - control_reset_offsets(c); c->control_state = NULL; free(cs); diff --git a/screen-redraw.c b/screen-redraw.c index d5ce44f0..c896340a 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1112,11 +1112,17 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx, if (sb_x >= sx || sb_y >= sy) return; imax = sb_w + sb_pad; - if ((int)imax + sb_x > sx) + if ((int)imax + sb_x > sx) { + if (sb_x >= sx) + return; imax = sx - sb_x; + } jmax = sb_h; - if ((int)jmax + sb_y > sy) + if ((int)jmax + sb_y > sy) { + if (sb_y >= sy) + return; jmax = sy - sb_y; + } for (j = 0; j < jmax; j++) { py = sb_y + j; diff --git a/utf8-combined.c b/utf8-combined.c index 1eee3b82..65ecf9cd 100644 --- a/utf8-combined.c +++ b/utf8-combined.c @@ -175,7 +175,7 @@ utf8_should_combine(const struct utf8_data *with, const struct utf8_data *add) return (1); break; } - return 0; + return (0); } static enum hanguljamo_subclass diff --git a/utf8.c b/utf8.c index dc966814..e57100fd 100644 --- a/utf8.c +++ b/utf8.c @@ -599,7 +599,7 @@ utf8_towc(const struct utf8_data *ud, wchar_t *wc) case 0: return (UTF8_ERROR); } - log_debug("UTF-8 %.*s is %05X", (int)ud->size, ud->data, (u_int)*wc); + log_debug("UTF-8 %.*s is U+%06X", (int)ud->size, ud->data, (u_int)*wc); return (UTF8_DONE); } diff --git a/window.c b/window.c index 1189ddef..59d1659e 100644 --- a/window.c +++ b/window.c @@ -374,12 +374,10 @@ window_pane_destroy_ready(struct window_pane *wp) { int n; - if (wp->pipe_fd != -1) { - if (EVBUFFER_LENGTH(wp->pipe_event->output) != 0) - return (0); - if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0) - return (0); - } + if (wp->pipe_fd != -1 && EVBUFFER_LENGTH(wp->pipe_event->output) != 0) + return (0); + if (ioctl(wp->fd, FIONREAD, &n) != -1 && n > 0) + return (0); if (~wp->flags & PANE_EXITED) return (0);