Fix: disallow negative width

This commit is contained in:
Nikita Ivanov 2022-09-02 01:47:18 +05:00
parent 285d72df3a
commit c54edbd235
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133

View File

@ -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);