dtfile: define MAX_PATH to PATH_MAX rather than 1024, also CID 87557
This commit is contained in:
@@ -106,7 +106,7 @@
|
|||||||
#include "SharedMsgs.h"
|
#include "SharedMsgs.h"
|
||||||
|
|
||||||
|
|
||||||
#define MAX_PATH 1024
|
#define MAX_PATH PATH_MAX
|
||||||
|
|
||||||
static char * CHANGEDIRECTORY = "ChangeDirectory";
|
static char * CHANGEDIRECTORY = "ChangeDirectory";
|
||||||
|
|
||||||
|
|||||||
@@ -2857,11 +2857,14 @@ _ReadDir(
|
|||||||
/* read subdirectory */
|
/* read subdirectory */
|
||||||
if (fp->is_subdir)
|
if (fp->is_subdir)
|
||||||
{
|
{
|
||||||
/* construct sub directory name */
|
/* construct sub directory name */
|
||||||
strcpy(subdir_name, directory_name);
|
strncpy(subdir_name, directory_name, MAX_PATH - 1);
|
||||||
if (subdir_name[strlen(subdir_name) - 1] != '/')
|
if (strlen(subdir_name) > 0
|
||||||
strcat(subdir_name, "/");
|
&& subdir_name[strlen(subdir_name) - 1] != '/')
|
||||||
strcat(subdir_name, fp->file_name);
|
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 */
|
/* see if we know this entry from branch_list */
|
||||||
if (!QueryBranchList(file_mgr_data, branch_list, subdir_name, &ts))
|
if (!QueryBranchList(file_mgr_data, branch_list, subdir_name, &ts))
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
/* Generally used defines */
|
/* Generally used defines */
|
||||||
|
|
||||||
#define MAX_PATH 1024
|
#define MAX_PATH PATH_MAX
|
||||||
#define BLOCK_SIZE 1024
|
#define BLOCK_SIZE 1024
|
||||||
#define BUF_SIZE 256
|
#define BUF_SIZE 256
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
************************************<+>*************************************/
|
************************************<+>*************************************/
|
||||||
|
|
||||||
/* Macros */
|
/* Macros */
|
||||||
#define MAX_PATH 1024
|
#define MAX_PATH PATH_MAX
|
||||||
|
|
||||||
#define G_OVERWRITE_EXISTING 0
|
#define G_OVERWRITE_EXISTING 0
|
||||||
#define G_SKIP 1
|
#define G_SKIP 1
|
||||||
|
|||||||
@@ -49,7 +49,8 @@
|
|||||||
|
|
||||||
#define TIGHTNESS 20 /* button spacing in Create_Action_Area */
|
#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 */
|
/* Types */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user