Avoid C99ism in Win32 code (#16651)

This commit is contained in:
Behdad Esfahbod 2008-08-12 14:10:03 -04:00
parent f7364e6273
commit e04afe83de
2 changed files with 4 additions and 2 deletions

View File

@ -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");
}

View File

@ -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");
}