aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fclang.c
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src/fclang.c')
-rw-r--r--fontconfig/src/fclang.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/fontconfig/src/fclang.c b/fontconfig/src/fclang.c
index 9f685f6fd..b1fd1bcae 100644
--- a/fontconfig/src/fclang.c
+++ b/fontconfig/src/fclang.c
@@ -720,19 +720,22 @@ FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *vbuf)
memset (buf->ls.map, '\0', sizeof (buf->ls.map));
buf->ls.map_size = NUM_LANG_SET_MAP;
buf->ls.extra = 0;
- id = FcLangSetIndex (lang);
- if (id > 0)
+ if (lang)
{
- FcLangSetBitSet (&buf->ls, id);
- }
- else
- {
- buf->ls.extra = &buf->strs;
- buf->strs.num = 1;
- buf->strs.size = 1;
- buf->strs.strs = &buf->str;
- FcRefInit (&buf->strs.ref, 1);
- buf->str = (FcChar8 *) lang;
+ id = FcLangSetIndex (lang);
+ if (id > 0)
+ {
+ FcLangSetBitSet (&buf->ls, id);
+ }
+ else
+ {
+ buf->ls.extra = &buf->strs;
+ buf->strs.num = 1;
+ buf->strs.size = 1;
+ buf->strs.strs = &buf->str;
+ FcRefInit (&buf->strs.ref, 1);
+ buf->str = (FcChar8 *) lang;
+ }
}
return &buf->ls;
}