From: Matthew Fernandez Date: Thu, 18 Aug 2022 02:17:34 +0000 (-0700) Subject: common record_path: fix truncation to int during path calculation X-Git-Tag: 6.0.1~33^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c78d662b2cae1e60d520f218fa0557494ffabf2;p=graphviz common record_path: fix truncation to int during path calculation This looks to have been a typo in ebd6191b0eec6e23d96c92aaa06212de339207e3 that switched this code to operate on double points instead of int points, in that it did not also update the local temporaries used in this calculation. As a result, this function produced inaccurate answers due to rounding when points were too close together and downright wrong answers when points did not fit in an int data type. Squashes 4 -Wfloat-conversion warnings. --- diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 4cc117b77..e156945dc 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -3639,7 +3639,8 @@ static bool record_inside(inside_t * inside_context, pointf p) static int record_path(node_t * n, port * prt, int side, boxf rv[], int *kptr) { - int i, ls, rs; + int i; + double ls, rs; pointf p; field_t *info;