From c54edbd235354317afcc520453214ef0955a9176 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Fri, 2 Sep 2022 01:47:18 +0500 Subject: [PATCH] Fix: disallow negative width --- src/ctpv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ctpv.c b/src/ctpv.c index d6dd5a0..c402df4 100644 --- a/src/ctpv.c +++ b/src/ctpv.c @@ -242,7 +242,7 @@ static RESULT preview(int argc, char *argv[]) } /* To some reason lf chops off last 2 characters of a line */ - w_l -= 2; + w_l = MAX(0, w_l - 2); snprintf(w_buf, LEN(w_buf), "%ld", w_l); snprintf(h_buf, LEN(h_buf), "%ld", h_l);