summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2017-09-27 16:50:30 -0400
committerBehdad Esfahbod <behdad@behdad.org>2017-09-27 18:37:00 -0400
commit554041d59679d99e9c5ba0a01c3fa743eef7bd7f (patch)
treea56f76030ff0c11b50bbaf8326d4c77b9310924a /src
parenta74109a1142a1525a310f95cb44931de545e025f (diff)
Fix whitespace-trimming loop and empty strings...
Diffstat (limited to 'src')
-rw-r--r--src/fcfreetype.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 6ff717a3..dfa268be 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1502,10 +1502,10 @@ FcFreeTypeQueryFaceInternal (const FT_Face face,
pp++;
len = strlen ((const char *) pp);
memmove (utf8, pp, len + 1);
- pp = utf8 + len - 1;
- while (*pp == ' ')
+ pp = utf8 + len;
+ while (pp > utf8 && *(pp - 1) == ' ')
pp--;
- *(pp + 1) = 0;
+ *pp = 0;
if (FcStringInPatternElement (pat, elt, utf8))
{