[Fontconfig] fontconfig: Branch 'main'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 7 05:33:08 UTC 2021


 src/fcfreetype.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit ce00010b1fadffccd2ba94d2b1932d4f5ff38f8e
Author: Ben Wagner <bungeman at chromium.org>
Date:   Mon Dec 6 16:52:14 2021 -0500

    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.

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);


More information about the Fontconfig mailing list