[Fontconfig] [PATCH 3/3] Fix erroneous test on language id in FcLangSetPromote()

Florent Rougon f.rougon at free.fr
Tue Jun 6 23:34:51 UTC 2017


FcLangSetIndex() indicates "not found" with a non-negative return value.
Return value 0 doesn't imply "not found", it rather means "language
found with index 0 in fcLangData".
---
 src/fclang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fclang.c b/src/fclang.c
index 50ea793..affab50 100644
--- a/src/fclang.c
+++ b/src/fclang.c
@@ -732,7 +732,7 @@ FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *vbuf)
     if (lang)
     {
 	id = FcLangSetIndex (lang);
-	if (id > 0)
+	if (id >= 0)
 	{
 	    FcLangSetBitSet (&buf->ls, id);
 	}
-- 
2.11.0



More information about the Fontconfig mailing list