mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 21:53:46 +01:00
Revert change from 481e52fd and change path_max to long.
pathconf returns -1 on error and if there is no limit. A buffer with size (size_t) -1 would be too large.
This commit is contained in:
parent
6730160df0
commit
4f53b083ef
@ -35,12 +35,12 @@ cc_open(girara_session_t* session, char* input)
|
||||
/* If the path does not begin with a slash we update the path with the current
|
||||
* working directory */
|
||||
if (strlen(path) == 0 || path[0] != '/') {
|
||||
size_t path_max;
|
||||
long path_max;
|
||||
#ifdef PATH_MAX
|
||||
path_max = PATH_MAX;
|
||||
#else
|
||||
path_max = pathconf(path,_PC_PATH_MAX);
|
||||
if (path_max == 0)
|
||||
if (path_max <= 0)
|
||||
path_max = 4096;
|
||||
#endif
|
||||
|
||||
|
@ -173,12 +173,12 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
|
||||
}
|
||||
|
||||
/* determine real path */
|
||||
size_t path_max;
|
||||
long path_max;
|
||||
#ifdef PATH_MAX
|
||||
path_max = PATH_MAX;
|
||||
#else
|
||||
path_max = pathconf(path,_PC_PATH_MAX);
|
||||
if (path_max == 0)
|
||||
if (path_max <= 0)
|
||||
path_max = 4096;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user