poly2d/p2d_attrib.c (p2d_no_intersect): don't test last vs. first segment

This one case slipped through. Surprisingly, it rarely produced a
complaint.
This commit is contained in:
Werner Almesberger 2015-01-18 09:09:43 -03:00
parent f94fb2f74a
commit 84f9d3c3b4
1 changed files with 2 additions and 5 deletions

View File

@ -4,8 +4,7 @@
* Written 2012, 2015 by Werner Almesberger
* Copyright 2012, 2015 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
@ -89,15 +88,13 @@ bool p2d_no_intersect(const struct p2d *p)
u = u->next;
if (!u || u == p->v)
return 1;
while (u && u->next) {
while (u && u->next && u->next != v) {
if (v2d_intersect(v, v->next, u, u->next,
NULL, NULL) > 0)
return 0;
u = u->next;
if (u == p->v)
break;
if (u->next == v)
break;
}
v = v->next;
if (v == p->v)