Avoid C99ism in Win32 code (#16651)
This commit is contained in:
parent
f7364e6273
commit
e04afe83de
|
@ -1671,9 +1671,10 @@ FcConfigGetPath (void)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (fontconfig_path[0] == '\0')
|
if (fontconfig_path[0] == '\0')
|
||||||
{
|
{
|
||||||
|
char *p;
|
||||||
if(!GetModuleFileName(NULL, fontconfig_path, sizeof(fontconfig_path)))
|
if(!GetModuleFileName(NULL, fontconfig_path, sizeof(fontconfig_path)))
|
||||||
goto bail1;
|
goto bail1;
|
||||||
char *p = strrchr (fontconfig_path, '\\');
|
p = strrchr (fontconfig_path, '\\');
|
||||||
if (p) *p = '\0';
|
if (p) *p = '\0';
|
||||||
strcat (fontconfig_path, "\\fonts");
|
strcat (fontconfig_path, "\\fonts");
|
||||||
}
|
}
|
||||||
|
|
|
@ -2060,6 +2060,7 @@ FcEndElement(void *userData, const XML_Char *name)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (strcmp (data, "CUSTOMFONTDIR") == 0)
|
if (strcmp (data, "CUSTOMFONTDIR") == 0)
|
||||||
{
|
{
|
||||||
|
char *p;
|
||||||
FcStrFree (data);
|
FcStrFree (data);
|
||||||
data = malloc (1000);
|
data = malloc (1000);
|
||||||
if (!data)
|
if (!data)
|
||||||
|
@ -2074,7 +2075,7 @@ FcEndElement(void *userData, const XML_Char *name)
|
||||||
FcStrFree (data);
|
FcStrFree (data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
char *p = strrchr (data, '\\');
|
p = strrchr (data, '\\');
|
||||||
if (p) *p = '\0';
|
if (p) *p = '\0';
|
||||||
strcat (data, "\\fonts");
|
strcat (data, "\\fonts");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue