Fix a typo that accessing to the out of array

This commit is contained in:
Akira TAGOH 2012-12-11 12:35:02 +09:00
parent cef2b50c66
commit 5ea3118ad6
1 changed files with 1 additions and 1 deletions

View File

@ -1193,7 +1193,7 @@ FcStrSetAddLangs (FcStrSet *strs, const char *languages)
while ((next = strchr (p, ':'))) while ((next = strchr (p, ':')))
{ {
len = next - p; len = next - p;
len = FC_MIN (len, 128); len = FC_MIN (len, 127);
strncpy ((char *) lang, p, len); strncpy ((char *) lang, p, len);
lang[len] = 0; lang[len] = 0;
/* ignore an empty item */ /* ignore an empty item */