summaryrefslogtreecommitdiff
path: root/src/fcfs.c
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2006-02-06 14:44:46 +0000
committerPatrick Lam <plam@MIT.EDU>2006-02-06 14:44:46 +0000
commit86e75dfb5d1434837537b40e829f00f9ffbb8183 (patch)
tree60af5f46cf1db8d4c5565aacf08d0ecc697ec156 /src/fcfs.c
parentf076169d19574c6c548764d574a33bc4fe022ffb (diff)
downloadfontconfig-86e75dfb5d1434837537b40e829f00f9ffbb8183.tar.gz
Explain apples/oranges comparison and fix compilation error.
reviewed by: plam
Diffstat (limited to 'src/fcfs.c')
-rw-r--r--src/fcfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fcfs.c b/src/fcfs.c
index 50049ba..cbb5dc7 100644
--- a/src/fcfs.c
+++ b/src/fcfs.c
@@ -159,7 +159,10 @@ FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr)
nfont = *(int *)block_ptr;
block_ptr = (int *)block_ptr + 1;
- if (nfont > 0 && nfont < metadata.count)
+ /* comparing nfont and metadata.count is a bit like comparing
+ apples and oranges. Its just for rejecting totally insane
+ nfont values, and for that its good enough */
+ if (nfont > 0 && nfont < metadata->count / sizeof(void*))
{
FcPattern * p = (FcPattern *)block_ptr;