Explain apples/oranges comparison and fix compilation error.

reviewed by: plam
This commit is contained in:
Patrick Lam 2006-02-06 14:44:46 +00:00
parent f076169d19
commit 86e75dfb5d
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2006-02-06 Dirk Mueller <dmueller@suse.de>
reviewed by: plam
* src/fcfs.c (FcFontSetUnserialize):
Explain apples/oranges comparison and fix compilation error.
2006-02-06 Dirk Mueller <dmueller@suse.de> 2006-02-06 Dirk Mueller <dmueller@suse.de>
reviewed by: plam reviewed by: plam

View File

@ -159,7 +159,10 @@ FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr)
nfont = *(int *)block_ptr; nfont = *(int *)block_ptr;
block_ptr = (int *)block_ptr + 1; 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; FcPattern * p = (FcPattern *)block_ptr;