From 9824dc894440bc2566206bb5f04d403d68bf24c0 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 12 Aug 2002 11:43:56 +0000 Subject: [PATCH] Fixed XrPathClose to deal with empty path --- src/xrpath.c | 6 ++++-- xrpath.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xrpath.c b/src/xrpath.c index 57488a453..766a9e81e 100644 --- a/src/xrpath.c +++ b/src/xrpath.c @@ -168,6 +168,8 @@ XrPathLineTo(XrPath *path, const XPointDouble *pt) void XrPathClose(XrPath *path) { - XrSubPathClose(path->tail); - XrPathNewSubPath(path); + if (path->tail) { + XrSubPathClose(path->tail); + XrPathNewSubPath(path); + } } diff --git a/xrpath.c b/xrpath.c index 57488a453..766a9e81e 100644 --- a/xrpath.c +++ b/xrpath.c @@ -168,6 +168,8 @@ XrPathLineTo(XrPath *path, const XPointDouble *pt) void XrPathClose(XrPath *path) { - XrSubPathClose(path->tail); - XrPathNewSubPath(path); + if (path->tail) { + XrSubPathClose(path->tail); + XrPathNewSubPath(path); + } }