* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <fontconfig/fontconfig.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#else
#define HAVE_GETOPT 1
#endif
+#include <fontconfig/fontconfig.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
#ifndef HAVE_GETOPT
#define HAVE_GETOPT 0
#endif
#undef _GNU_SOURCE
#define _GNU_SOURCE
#include <getopt.h>
-const struct option longopts[] = {
+static const struct option longopts[] = {
{"sort", 0, 0, 's'},
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "Vv?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "sVv?", longopts, NULL)) != -1)
#else
while ((c = getopt (argc, argv, "sVv?")) != -1)
#endif
else
pat = FcPatternCreate ();
+ if (!pat)
+ return 1;
+
FcConfigSubstitute (0, pat, FcMatchPattern);
FcDefaultSubstitute (pat);
if (match)
FcFontSetAdd (fs, match);
}
- if (pat)
- FcPatternDestroy (pat);
+ FcPatternDestroy (pat);
if (fs)
{
}
FcFontSetDestroy (fs);
}
+ FcFini ();
return 0;
}