From: Jean-Philippe Bruyère Date: Thu, 27 Aug 2020 11:44:51 +0000 (+0200) Subject: update nanosvg copyright X-Git-Tag: v0.2.0~102 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=f447cb4696d4079ac1477b21106a8a46fd185834;p=jp%2Fvkvg.git update nanosvg copyright --- diff --git a/src/nanosvg.h b/src/nanosvg.h index b2430a5..5579449 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-14 Mikko Mononen memon@inside.org + * Copyright (c) 2019-20 Michael Tesch * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -26,6 +27,7 @@ * */ + #ifndef NANOSVG_H #define NANOSVG_H @@ -2958,32 +2960,32 @@ error: NSVGpath* nsvgDuplicatePath(NSVGpath* p) { - NSVGpath* res = NULL; + NSVGpath* res = NULL; - if (p == NULL) - return NULL; + if (p == NULL) + return NULL; - res = (NSVGpath*)malloc(sizeof(NSVGpath)); - if (res == NULL) goto error; - memset(res, 0, sizeof(NSVGpath)); + res = (NSVGpath*)malloc(sizeof(NSVGpath)); + if (res == NULL) goto error; + memset(res, 0, sizeof(NSVGpath)); - res->pts = (float*)malloc(p->npts*2*sizeof(float)); - if (res->pts == NULL) goto error; - memcpy(res->pts, p->pts, p->npts * sizeof(float) * 2); - res->npts = p->npts; + res->pts = (float*)malloc(p->npts*2*sizeof(float)); + if (res->pts == NULL) goto error; + memcpy(res->pts, p->pts, p->npts * sizeof(float) * 2); + res->npts = p->npts; - memcpy(res->bounds, p->bounds, sizeof(p->bounds)); + memcpy(res->bounds, p->bounds, sizeof(p->bounds)); - res->closed = p->closed; + res->closed = p->closed; - return res; + return res; error: - if (res != NULL) { - free(res->pts); - free(res); - } - return NULL; + if (res != NULL) { + free(res->pts); + free(res); + } + return NULL; } void nsvgDelete(NSVGimage* image)