From: Matthew Fernandez Date: Thu, 18 Aug 2022 01:28:15 +0000 (-0700) Subject: common emit_html_rules: perform base calculation uniformly on doubles X-Git-Tag: 6.0.1~33^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc17d35dd94b4a84d20aa245abe27886427efa72;p=graphviz 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. --- 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;