From 54e2b0b005347810571a44b1ad64f9c14cf56e92 Mon Sep 17 00:00:00 2001 From: Max Hollmann Date: Wed, 15 Jul 2020 09:53:13 +0200 Subject: [PATCH 1/2] limit font size to non-negative values --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 40bfbc90..84c9d459 100644 --- a/terminal.c +++ b/terminal.c @@ -1430,7 +1430,7 @@ term_font_size_adjust(struct terminal *term, double amount) old_pt_size = term->font_sizes[i].px_size * 72. / dpi; } - term->font_sizes[i].pt_size = old_pt_size + amount; + term->font_sizes[i].pt_size = fmax(old_pt_size + amount, 0); term->font_sizes[i].px_size = -1; } From 5ae45c3b45e13104ce344940d37f5848cc88d9e2 Mon Sep 17 00:00:00 2001 From: Max Hollmann Date: Wed, 15 Jul 2020 11:05:22 +0200 Subject: [PATCH 2/2] added font-size limitting to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb27893..b06dc6bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,8 @@ * A multi-column character that does not fit on the current line is now printed on the next line, instead of only printing half the character. +* Font size can no longer be reduced to negative values + (https://codeberg.org/dnkl/foot/issues/38). ### Security