From ce00010b1fadffccd2ba94d2b1932d4f5ff38f8e Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 6 Dec 2021 16:52:14 -0500 Subject: [PATCH] Actually skip leading spaces in style name Because the loop body is just 'break' the loop never loops and at most one leading space is skipped. Remove the body to allow the loop to continue. Found with ClangTidy. --- src/fcfreetype.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fcfreetype.c b/src/fcfreetype.c index c477774..b6bfaca 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -1717,8 +1717,7 @@ FcFreeTypeQueryFaceInternal (const FT_Face face, if (FcPatternObjectGetString (pat, FC_STYLE_OBJECT, n, &style) != FcResultMatch) goto bail1; len = strlen ((const char *) style); - for (i = 0; style[i] != 0 && isspace (style[i]); i++) - break; + for (i = 0; style[i] != 0 && isspace (style[i]); i++); memcpy (style, &style[i], len - i); FcStrBufInit (&sbuf, NULL, 0); FcStrBufString (&sbuf, family);