diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx index 2715422cb..fc389802c 100644 --- a/fluid/template_panel.cxx +++ b/fluid/template_panel.cxx @@ -213,7 +213,7 @@ void template_delete_cb(Fl_Button *, void *) { void template_load() { int i; - char name[1024], filename[1024], path[1024], *ptr; + char name[1024], filename[1400], path[1024], *ptr; struct dirent **files; int num_files; diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl index 5fe717ea4..1ae706066 100644 --- a/fluid/template_panel.fl +++ b/fluid/template_panel.fl @@ -209,7 +209,7 @@ template_browser->do_callback();} {} Function {template_load()} {return_type void } { code {int i; -char name[1024], filename[1024], path[1024], *ptr; +char name[1024], filename[1400], path[1024], *ptr; struct dirent **files; int num_files; diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index febf85098..06ca17eca 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -700,7 +700,7 @@ void Fl_File_Chooser::fileListCB() { char *filename, // New filename - pathname[FL_PATH_MAX]; // Full pathname to file + pathname[FL_PATH_MAX + 4]; // Full pathname to file filename = (char *)fileList->text(fileList->value()); @@ -899,7 +899,7 @@ Fl_File_Chooser::fileNameCB() directory(pathname); if (filename[0]) { - char tempname[FL_PATH_MAX]; + char tempname[FL_PATH_MAX + 4]; snprintf(tempname, sizeof(tempname), "%s/%s", directory_, filename); fileName->value(tempname); @@ -1057,8 +1057,8 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s) void Fl_File_Chooser::newdir() { - const char *dir; // New directory name - char pathname[FL_PATH_MAX]; // Full path of directory + const char *dir; // New directory name + char pathname[FL_PATH_MAX + 4]; // Full path of directory // Get a directory name from the user @@ -1479,7 +1479,7 @@ Fl_File_Chooser::value(int f) // I - File number int i; // Looping var int fcount; // Number of selected files const char *name; // Current filename - static char pathname[FL_PATH_MAX]; // Filename + directory + static char pathname[FL_PATH_MAX + 4]; // Filename + directory name = fileName->value(); diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx index 1f13e7372..0160bed53 100644 --- a/src/Fl_File_Icon2.cxx +++ b/src/Fl_File_Icon2.cxx @@ -596,7 +596,7 @@ void Fl_File_Icon::load_system_icons(void) { int i; // Looping var Fl_File_Icon *icon; // New icons - char filename[FL_PATH_MAX]; // Filename + char filename[FL_PATH_MAX + 60]; // Filename char icondir[FL_PATH_MAX]; // Icon directory static int init = 0; // Have the icons been initialized? const char * const icondirs[] = { @@ -841,7 +841,7 @@ load_kde_mimelnk(const char *filename, // I - mimelnk filename char pattern[1024]; char mimetype[1024]; char *val; - char full_iconfilename[FL_PATH_MAX]; + char full_iconfilename[2 * FL_PATH_MAX]; Fl_File_Icon *icon; diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 5d3bc8fa5..e647b4b99 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -2781,7 +2781,7 @@ Fl_Shared_Image * Fl_Help_View::get_image(const char *name, int W, int H) { const char *localname; // Local filename char dir[FL_PATH_MAX]; // Current directory - char temp[FL_PATH_MAX], // Temporary filename + char temp[2 * FL_PATH_MAX], // Temporary filename *tempptr; // Pointer into temporary name Fl_Shared_Image *ip; // Image pointer... @@ -2878,7 +2878,7 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp) if (strcmp(linkp->filename, filename_) != 0 && linkp->filename[0]) { char dir[FL_PATH_MAX]; // Current directory - char temp[FL_PATH_MAX], // Temporary filename + char temp[2 * FL_PATH_MAX], // Temporary filename *tempptr; // Pointer into temporary filename @@ -3297,7 +3297,7 @@ Fl_Help_View::load(const char *f)// I - Filename to load (may also have target) char *target; // Target in file char *slash; // Directory separator const char *localname; // Local filename - char error[1024]; // Error buffer + char error[2 * FL_PATH_MAX]; // Error buffer char newname[FL_PATH_MAX]; // New filename buffer // printf("load(%s)\n",f); fflush(stdout); diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index 9e5427b3c..d6515473b 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -251,7 +251,7 @@ pdf_check(const char *name, // I - Name of file { const char *home; // Home directory char preview[FL_PATH_MAX], // Preview filename - command[FL_PATH_MAX]; // Command + command[3 * FL_PATH_MAX]; // Command if (memcmp(header, "%PDF", 4) != 0) @@ -283,7 +283,7 @@ ps_check(const char *name, // I - Name of file const char *home; // Home directory char preview[FL_PATH_MAX], // Preview filename outname[FL_PATH_MAX], // Preview PS file - command[FL_PATH_MAX]; // Command + command[3 * FL_PATH_MAX]; // Command FILE *in, // Input file *out; // Output file int page; // Current page