|
commit a394e7aff0861003e437f53a7f53bcda51eb2025
Author: Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Fri Nov 5 18:27:06 2021 +0100
Commit: Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Fri Nov 5 18:50:55 2021 +0100
Fix compiler warnings (backported from 1.4)
fluid/template_panel.cxx | 2 +-
fluid/template_panel.fl | 2 +-
src/Fl_File_Chooser2.cxx | 10 +++++-----
src/Fl_File_Icon2.cxx | 4 ++--
src/Fl_Help_View.cxx | 6 +++---
test/file_chooser.cxx | 4 ++--
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git fluid/template_panel.cxx fluid/template_panel.cxx
index 2715422..fc38980 100644
--- fluid/template_panel.cxx
+++ 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 fluid/template_panel.fl fluid/template_panel.fl
index 5fe717e..1ae7060 100644
--- fluid/template_panel.fl
+++ 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 src/Fl_File_Chooser2.cxx src/Fl_File_Chooser2.cxx
index febf850..06ca17e 100644
--- src/Fl_File_Chooser2.cxx
+++ 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 src/Fl_File_Icon2.cxx src/Fl_File_Icon2.cxx
index 1f13e73..0160bed 100644
--- src/Fl_File_Icon2.cxx
+++ 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 src/Fl_Help_View.cxx src/Fl_Help_View.cxx
index 5d3bc8f..e647b4b 100644
--- src/Fl_Help_View.cxx
+++ 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 test/file_chooser.cxx test/file_chooser.cxx
index 9e5427b..d651547 100644
--- test/file_chooser.cxx
+++ 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
[ Direct Link to Message ] | |