diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-10-23 21:05:57 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-10-23 21:05:57 +0300 |
commit | c2a68188bdf70687be0194860f77849dca058fc9 (patch) | |
tree | e4f524fa1585ac59d293a8ed593fb755109fa27b | |
parent | 42843e2c444edc98632e8e5b8073c184332bdd94 (diff) |
memview: draw_error make sure there's space
Don't - cur.x if cur.x > screen width
-rw-r--r-- | src/memview.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/memview.c b/src/memview.c index c64d9fd..8852da8 100644 --- a/src/memview.c +++ b/src/memview.c @@ -358,7 +358,7 @@ draw_error(const char *line, void *data) (void)data; size_t w = snprintf(NULL, 0, "%s", line); w = (w < ctx.term.ws.w ? w : ctx.term.ws.w); screen_cursor(ctx.term.ws.w / 2 - w / 2, ctx.term.ws.h / 2); - screen_nprintf(ctx.term.ws.w - ctx.term.cur.x, "%s", line); + screen_nprintf(ctx.term.ws.w - ctx.term.cur.x * (ctx.term.cur.x < ctx.term.ws.w), "%s", line); } static void |