summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wagner <bungeman@chromium.org>2020-12-04 15:00:08 -0500
committerBen Wagner <bungeman@chromium.org>2020-12-04 15:05:38 -0500
commit3d6926380dc3c8597dc2fd9d34087da9b39dfdd9 (patch)
tree1658b6bc6a097b8220f95a43563efd6a1e6d48ab
parent93c93689f5da4ceaa675e006df63283e25b91d49 (diff)
Skip leading whitespace in style name.
Found by Clang-Tidy. The intent seems to have been to skip all leading whitespace in the 'style' string, but instead this loop was an odd looking no-op. Remove the 'break' from the loop so that it will continue until end of string or a non-space character is found.
-rw-r--r--src/fcopentype.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/fcopentype.c b/src/fcopentype.c
index 59cce45..39c05e9 100644
--- a/src/fcopentype.c
+++ b/src/fcopentype.c
@@ -66,8 +66,7 @@ FcPatternAddFullname (FcPattern *pat)
if (FcPatternObjectGetString (pat, FC_STYLE_OBJECT, n, &style) != FcResultMatch)
return FcFalse;
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);