Fix -Wstringop-truncation warning
This commit is contained in:
parent
684c3ce685
commit
94080c3d48
|
@ -841,15 +841,14 @@ FcFontSetMatchInternal (FcFontSet **sets,
|
||||||
if (!(p = strchr (s, ',')))
|
if (!(p = strchr (s, ',')))
|
||||||
{
|
{
|
||||||
f = FcFalse;
|
f = FcFalse;
|
||||||
len = strlen (s) + 1;
|
len = strlen (s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
len = (p - s) + 1;
|
len = (p - s);
|
||||||
}
|
}
|
||||||
x = malloc (sizeof (char) * len);
|
x = malloc (sizeof (char) * (len + 1));
|
||||||
strncpy (x, s, len - 1);
|
strcpy (x, s);
|
||||||
x[len - 1] = 0;
|
|
||||||
if (FcObjectFromName (x) > 0)
|
if (FcObjectFromName (x) > 0)
|
||||||
FcObjectSetAdd (os, x);
|
FcObjectSetAdd (os, x);
|
||||||
s = p + 1;
|
s = p + 1;
|
||||||
|
|
Loading…
Reference in New Issue