From 6e6aea5e54847a9b16b45fb0b66470070b5da566 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 3 Jan 2009 09:52:49 +0000 Subject: [PATCH] Fixed list realloc --- Src/C64_SDL.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/C64_SDL.i b/Src/C64_SDL.i index 74eceec..9ee1275 100644 --- a/Src/C64_SDL.i +++ b/Src/C64_SDL.i @@ -136,10 +136,10 @@ void C64::select_disc(Prefs *np) p = strdup(de->d_name); file_list[cur++] = p; file_list[cur] = NULL; - if (cur > cnt - 1) + if (cur > cnt - 2) { cnt = cnt + 32; - file_list = (char**)realloc(file_list, cnt); + file_list = (char**)realloc(file_list, cnt * sizeof(char*)); if (!file_list) return; }