diff options
author | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2016-01-12 18:49:43 +0100 |
---|---|---|
committer | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2016-01-13 20:49:48 +0100 |
commit | de41f9854ec827c5cfe89cc44c644e4c38a6faa0 (patch) | |
tree | 52fbb44212e56c4db98f40cb50fc1f20d030ac48 /src/navigator.c | |
parent | 1665390ee94a160618b2bfdeeb1d7b993ee8a264 (diff) | |
download | imv-de41f9854ec827c5cfe89cc44c644e4c38a6faa0.tar.gz |
Use PATH_MAX for buffers holding paths
Diffstat (limited to 'src/navigator.c')
-rw-r--r-- | src/navigator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/navigator.c b/src/navigator.c index fb2a3cd..dd5124d 100644 --- a/src/navigator.c +++ b/src/navigator.c @@ -17,6 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "navigator.h" +#include <limits.h> #include <sys/stat.h> #include <dirent.h> #include <stdlib.h> @@ -84,7 +85,7 @@ static void add_item(struct imv_navigator *nav, const char *path, void imv_navigator_add(struct imv_navigator *nav, const char *path, int recursive) { - char path_buf[512]; + char path_buf[PATH_MAX]; struct stat path_info; stat(path, &path_info); if(S_ISDIR(path_info.st_mode)) { |