From 6e5c472cf9641426c5425ea2f404e8908d76d63e Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 26 Nov 2022 01:35:50 +0100 Subject: Handle Fluid project settings better (#556) Fix allocation bug in Fl_String --- fluid/ExternalCodeEditor_UNIX.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fluid/ExternalCodeEditor_UNIX.cxx') diff --git a/fluid/ExternalCodeEditor_UNIX.cxx b/fluid/ExternalCodeEditor_UNIX.cxx index e7c79d9f0..10e7f7195 100644 --- a/fluid/ExternalCodeEditor_UNIX.cxx +++ b/fluid/ExternalCodeEditor_UNIX.cxx @@ -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; } -- cgit v1.2.3