mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-23 03:49:26 +01:00
Fixed list realloc
This commit is contained in:
parent
fceafc55fd
commit
6e6aea5e54
@ -136,10 +136,10 @@ void C64::select_disc(Prefs *np)
|
|||||||
p = strdup(de->d_name);
|
p = strdup(de->d_name);
|
||||||
file_list[cur++] = p;
|
file_list[cur++] = p;
|
||||||
file_list[cur] = NULL;
|
file_list[cur] = NULL;
|
||||||
if (cur > cnt - 1)
|
if (cur > cnt - 2)
|
||||||
{
|
{
|
||||||
cnt = cnt + 32;
|
cnt = cnt + 32;
|
||||||
file_list = (char**)realloc(file_list, cnt);
|
file_list = (char**)realloc(file_list, cnt * sizeof(char*));
|
||||||
if (!file_list)
|
if (!file_list)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user