From: Behdad Esfahbod Date: Tue, 12 Aug 2008 18:10:03 +0000 (-0400) Subject: Avoid C99ism in Win32 code (#16651) X-Git-Tag: 2.7.0~188 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e04afe83de409b880be9a854b34fb624bca5c3b0;p=fontconfig.git Avoid C99ism in Win32 code (#16651) --- diff --git a/src/fccfg.c b/src/fccfg.c index acb0bb4..e5b6787 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -1671,9 +1671,10 @@ FcConfigGetPath (void) #ifdef _WIN32 if (fontconfig_path[0] == '\0') { + char *p; if(!GetModuleFileName(NULL, fontconfig_path, sizeof(fontconfig_path))) goto bail1; - char *p = strrchr (fontconfig_path, '\\'); + p = strrchr (fontconfig_path, '\\'); if (p) *p = '\0'; strcat (fontconfig_path, "\\fonts"); } diff --git a/src/fcxml.c b/src/fcxml.c index 90c079a..3de2e24 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -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"); }