summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/gui.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 4801325c4..7ea2334a1 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -393,14 +393,16 @@ STRPTR ami_locale_langs(void)
bool ami_gui_map_filename(char **remapped, const char *path, const char *file, const char *map)
{
BPTR fh = 0;
- char mapfile[1024];
- size_t mapfile_size = 1024;
+ char *mapfile = NULL;
+ size_t mapfile_size = 0;
char buffer[1024];
char *realfname;
bool found = false;
amiga_mkpath(&mapfile, &mapfile_size, 2, path, map);
+ if(mapfile == NULL) return false;
+
if(fh = FOpen(mapfile, MODE_OLDFILE, 0))
{
while(FGets(fh, buffer, 1024) != 0)
@@ -427,6 +429,8 @@ bool ami_gui_map_filename(char **remapped, const char *path, const char *file, c
if(found == false) *remapped = strdup(file);
else LOG(("Remapped %s to %s in path %s using %s", file, *remapped, path, map));
+ free(mapfile);
+
return found;
}