]> granicus.if.org Git - graphviz/commitdiff
reallyroutespline: squash a -Wsign-conversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 28 Jun 2022 01:42:29 +0000 (18:42 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Jul 2022 04:40:20 +0000 (21:40 -0700)
By construction, `inpn` can only ever be non-negative here. Though in the long
term a more sweeping change should be done to count items in `size_t` variables
pervasively.

lib/pathplan/route.c

index 0274d4b2e7fbcd9352e25173af5652fe570f52d8..69bb776fded24913d50035fdf8e8de1a0868a313 100644 (file)
@@ -105,7 +105,7 @@ static int reallyroutespline(Pedge_t * edges, int edgen,
     static int tnan;
 
     if (tnan < inpn) {
-       if (!(tnas = realloc(tnas, sizeof(tna_t) * inpn)))
+       if (!(tnas = realloc(tnas, sizeof(tna_t) * (size_t)inpn)))
            return -1;
        tnan = inpn;
     }