Fix the array allocation
This commit is contained in:
parent
f18f2f88f2
commit
2f311c562d
|
@ -219,7 +219,7 @@ FcScandir (const char *dirp,
|
||||||
dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1));
|
dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1));
|
||||||
p = (struct dirent *) malloc (dentlen);
|
p = (struct dirent *) malloc (dentlen);
|
||||||
memcpy (p, dent, dentlen);
|
memcpy (p, dent, dentlen);
|
||||||
if (n >= lsize)
|
if ((n + 1) >= lsize)
|
||||||
{
|
{
|
||||||
lsize += 128;
|
lsize += 128;
|
||||||
dlp = (struct dirent **) realloc (dlist, sizeof (struct dirent *) * lsize);
|
dlp = (struct dirent **) realloc (dlist, sizeof (struct dirent *) * lsize);
|
||||||
|
|
Loading…
Reference in New Issue