]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcxml.c
Reduce number of allocations during FcSortWalk().
[fontconfig.git] / src / fcxml.c
index 90c079addb17eb8e396b9d2130862bd90e12f59f..efdb297022ddb156bb44b4f02fc6727b7b04e974 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $RCSId: xc/lib/fontconfig/src/fcxml.c,v 1.21 2002/08/22 18:53:22 keithp Exp $
+ * fontconfig/src/fcxml.c
  *
  * Copyright © 2002 Keith Packard
  *
@@ -2060,6 +2060,7 @@ FcEndElement(void *userData, const XML_Char *name)
 #ifdef _WIN32
        if (strcmp (data, "CUSTOMFONTDIR") == 0)
        {
+               char *p;
                FcStrFree (data);
                data = malloc (1000);
                if (!data)
@@ -2074,7 +2075,7 @@ FcEndElement(void *userData, const XML_Char *name)
                        FcStrFree (data);
                        break;
                }
-               char *p = strrchr (data, '\\');
+               p = strrchr (data, '\\');
                if (p) *p = '\0';
                strcat (data, "\\fonts");
        }