From fc17d35dd94b4a84d20aa245abe27886427efa72 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 17 Aug 2022 18:28:15 -0700 Subject: [PATCH] common emit_html_rules: perform base calculation uniformly on doubles It is unclear to me why 070d24215a27219b33581c96c39e6e8811ba52a7 chose to perform these intermediate calculations truncating to unsigned char. This resulted in loss of accuracy and multiple possibilities for overflow. This change makes the computation more natural, squashing 7 compiler warnings. --- lib/common/htmltable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index a13274d36..960801f73 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -454,7 +454,7 @@ emit_html_rules(GVJ_t * job, htmlcell_t * cp, htmlenv_t * env, char *color, html { pointf rule_pt; double rule_length; - unsigned char base; + double base; boxf pts = cp->data.box; pointf pos = env->pos; -- 2.50.1