]> granicus.if.org Git - graphviz/commitdiff
return an error value instead of longjmping out of find_ints
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Apr 2021 02:43:34 +0000 (19:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 18 Apr 2021 00:30:16 +0000 (17:30 -0700)
Related to #1801.

lib/neatogen/legal.c

index 533f59581ba2248e3ebf7c3f3bc8d34622a33d9e..530496d4e3a401ddd4eafed734748b37793ab139 100644 (file)
@@ -271,7 +271,7 @@ static int gt(vertex **i, vertex **j)
 
 /* find_ints:
  * Check for pairwise intersection of polygon sides
- * Return 1 if intersection found, 0 otherwise.
+ * Return 1 if intersection found, 0 for not found, -1 for error.
  */
 static int
 find_ints(vertex vertex_list[],
@@ -335,7 +335,7 @@ find_ints(vertex vertex_list[],
 
                if ((tempa = templ->active) == 0) {
                    agerr(AGERR, "trying to delete a non-line\n");
-                   longjmp(jbuf, 1);
+                   return -1;
                }
                if (all.number == 1)
                    all.final = all.first = 0;  /* delete the line */