diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-11-26 01:35:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-26 01:35:50 +0100 |
| commit | 6e5c472cf9641426c5425ea2f404e8908d76d63e (patch) | |
| tree | 0f7ec46f88f01257702f1f9a7c8323a7fdc768c3 /fluid/ExternalCodeEditor_UNIX.cxx | |
| parent | c1a7c4af042a593b4b3a1df3e750b0cc80362486 (diff) | |
Handle Fluid project settings better (#556)
Fix allocation bug in Fl_String
Diffstat (limited to 'fluid/ExternalCodeEditor_UNIX.cxx')
| -rw-r--r-- | fluid/ExternalCodeEditor_UNIX.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |
