Handle Fluid project settings better (#556)

Fix allocation bug in Fl_String
This commit is contained in:
Matthias Melcher
2022-11-26 01:35:50 +01:00
committed by GitHub
parent c1a7c4af04
commit 6e5c472cf9
16 changed files with 295 additions and 253 deletions
+4 -4
View File
@@ -288,12 +288,12 @@ const char* ExternalCodeEditor::create_tmpdir() {
\return NULL if can't, posts dialog explaining why.
*/
const char* ExternalCodeEditor::tmp_filename() {
static char path[512];
static char path[FL_PATH_MAX+1];
const char *tmpdir = create_tmpdir();
if ( !tmpdir ) return 0;
const char *ext = code_file_name; // e.g. ".cxx"
snprintf(path, sizeof(path), "%s/%p%s", tmpdir, (void*)this, ext);
path[sizeof(path)-1] = 0;
const char *ext = P.code_file_name; // e.g. ".cxx"
snprintf(path, FL_PATH_MAX, "%s/%p%s", tmpdir, (void*)this, ext);
path[FL_PATH_MAX] = 0;
return path;
}