1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtfile: define MAX_PATH to PATH_MAX rather than 1024, also CID 87557

This commit is contained in:
Jon Trulson 2018-04-05 12:49:06 -06:00
parent 494fd64314
commit caa95ba67c
5 changed files with 13 additions and 9 deletions

View file

@ -106,7 +106,7 @@
#include "SharedMsgs.h"
#define MAX_PATH 1024
#define MAX_PATH PATH_MAX
static char * CHANGEDIRECTORY = "ChangeDirectory";

View file

@ -2857,11 +2857,14 @@ _ReadDir(
/* read subdirectory */
if (fp->is_subdir)
{
/* construct sub directory name */
strcpy(subdir_name, directory_name);
if (subdir_name[strlen(subdir_name) - 1] != '/')
strcat(subdir_name, "/");
strcat(subdir_name, fp->file_name);
/* construct sub directory name */
strncpy(subdir_name, directory_name, MAX_PATH - 1);
if (strlen(subdir_name) > 0
&& subdir_name[strlen(subdir_name) - 1] != '/')
strncat(subdir_name, "/", MAX_PATH - 1);
strncat(subdir_name, fp->file_name, MAX_PATH - 1);
subdir_name[MAX_PATH - 1] = 0;
/* see if we know this entry from branch_list */
if (!QueryBranchList(file_mgr_data, branch_list, subdir_name, &ts))

View file

@ -75,7 +75,7 @@
/* Generally used defines */
#define MAX_PATH 1024
#define MAX_PATH PATH_MAX
#define BLOCK_SIZE 1024
#define BUF_SIZE 256

View file

@ -39,7 +39,7 @@
************************************<+>*************************************/
/* Macros */
#define MAX_PATH 1024
#define MAX_PATH PATH_MAX
#define G_OVERWRITE_EXISTING 0
#define G_SKIP 1

View file

@ -49,7 +49,8 @@
#define TIGHTNESS 20 /* button spacing in Create_Action_Area */
#define MAX_PATH 1024 /* Maximum path length */
#include <limits.h>
#define MAX_PATH PATH_MAX /* Maximum path length */
/* Types */