From a5af6e1a507304bfc0cb2fa3727cff931c8655d6 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Tue, 5 Jul 2022 14:07:33 +0100 Subject: [PATCH] nanosvg: fix some dodgy checks --- include/nanosvg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nanosvg.h b/include/nanosvg.h index 93d27ca..1aceae1 100644 --- a/include/nanosvg.h +++ b/include/nanosvg.h @@ -978,7 +978,7 @@ static void nsvg__addShape(NSVGparser* p) shape->fillRule = attr->fillRule; shape->opacity = attr->opacity; - if (p->unicodeFlag) { + if (p->unicodeFlag[0]) { strcat(shape->unicode, p->unicodeFlag); if (p->horizAdvFlag) { shape->horizAdvX = strtol(p->horizAdvFlag, &end, 10); @@ -2973,7 +2973,7 @@ NSVGshape** nsvgGetTextShapes(NSVGimage* image, char* text, int textLen) for (shape = image->shapes; shape != NULL; shape = shape->next) { if (!(shape->flags & NSVG_FLAGS_VISIBLE)) continue; - if (shape->unicode && shape->unicode[0] == text[i]) { + if (shape->unicode[0] == text[i]) { ret[i] = shape; goto found; }