diff -ru -x changelog whysynth-20090403.nomod/src/gui_main.c whysynth-20090403/src/gui_main.c --- whysynth-20090403.nomod/src/gui_main.c 2009-04-21 20:43:30.000000000 +0200 +++ whysynth-20090403/src/gui_main.c 2011-04-06 13:57:14.456368986 +0200 @@ -62,7 +62,7 @@ unsigned int patches_allocated = 0; int patches_dirty; y_patch_t *patches = NULL; -char patches_tmp_filename[PATH_MAX]; +gchar *patches_tmp_filename = NULL; char *project_directory = NULL; int last_configure_load_was_from_tmp; @@ -304,7 +304,9 @@ int i; char *dir = get_tmp_directory(); - snprintf(patches_tmp_filename, PATH_MAX, "%s/WhySynth_patches-%s", dir, path); + if (patches_tmp_filename != NULL) + g_free(patches_tmp_filename); + patches_tmp_filename = g_strdup_printf ("%s/WhySynth_patches-%s", dir, path); for (i = strlen(dir) + 1; i < strlen(patches_tmp_filename); i++) { if (patches_tmp_filename[i] == '/') patches_tmp_filename[i] = '_'; @@ -428,6 +430,7 @@ /* clean up patches */ if (patches) free(patches); + if (patches_tmp_filename) g_free(patches_tmp_filename); if (project_directory) free(project_directory); /* clean up OSC support */