]> granicus.if.org Git - graphviz/commitdiff
squash a -Wsign-conversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Apr 2021 03:44:02 +0000 (20:44 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Apr 2021 21:02:40 +0000 (14:02 -0700)
lib/ortho/ortho.c

index 12321ee51ed6dcd095c77aec28a006d374aa0779..b50240d92ab6d26565b90064d6422a5a1a7dab05 100644 (file)
@@ -144,7 +144,8 @@ convertSPtoRoute (sgraph* g, snode* fst, snode* lst)
     snode* ptr;
     snode* next;
     snode* prev;  /* node in shortest path just previous to next */
-    int i, sz = 0;
+    int i;
+    size_t sz = 0;
     cell* cp;
     cell* ncp;
     segment seg;
@@ -155,6 +156,7 @@ convertSPtoRoute (sgraph* g, snode* fst, snode* lst)
        /* count no. of nodes in shortest path */
     for (ptr = fst; ptr; ptr = N_DAD(ptr)) sz++;
     rte.n = 0;
+    assert(sz >= 2);
     rte.segs = N_NEW(sz-2, segment);  /* at most sz-2 segments */
 
     seg.prev = seg.next = 0;