cameo/poly2d.c (paths_to_polys_z): correctly ignore empty paths

This commit is contained in:
Werner Almesberger 2015-01-16 08:38:30 -03:00
parent 4d15951807
commit c9c0e887e7
1 changed files with 5 additions and 2 deletions

View File

@ -1,8 +1,8 @@
/*
* poly2d.c - Poly2D interface functions
*
* Written 2012 by Werner Almesberger
* Copyright 2012 Werner Almesberger
* 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
@ -11,6 +11,7 @@
*/
#include <stdlib.h>
#include <math.h>
#include <assert.h>
@ -46,6 +47,8 @@ struct p2d *paths_to_polys_z(const struct path *paths,
if (path->first->z < zmin || path->first->z > zmax)
continue;
*last = path_to_poly(path);
if (!*last)
continue;
last = &(*last)->next;
}
return polys;