e = FcPatternObjectFindElt (pat,
FcObjectFromName ((const char *) c->word));
- if (e)
+ if (e || else_string)
{
- FcValueListPtr l;
+ FcValueListPtr l = NULL;
if (add_colon)
FcStrBufChar (buf, ':');
FcStrBufChar (buf, '=');
}
- l = FcPatternEltValues(e);
+ if (e)
+ l = FcPatternEltValues(e);
if (idx != -1)
{
}
else goto notfound;
}
- else
+ else if (l)
{
FcNameUnparseValueList (buf, l, '\0');
}
- }
- else
-notfound:
- {
- if (else_string)
- printf ("%s", else_string);
+ else
+ {
+ notfound:
+ if (else_string)
+ FcStrBufString (buf, else_string);
+ }
}
return FcTrue;