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

Florent Rougon <[email protected]>
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <256a41038af9c6e281ed6d0adfdef37cf8b636e2.1496823343.git.f.rougon@free.fr>
FcLangSetIndex() indicates "not found" with a non-negative return value.
Return value 0 doesn't imply "not found", it rather means "language
found at index 0 in fcLangCharSets".
---
 src/fclang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fclang.c b/src/fclang.c
index 19f3ddd..dbbe721 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

_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.