summaryrefslogtreecommitdiff
path: root/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'download.c')
-rw-r--r--download.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/download.c b/download.c
index ce22ea7..8512405 100644
--- a/download.c
+++ b/download.c
@@ -32,6 +32,7 @@
#include <sys/stat.h>
#include <fcntl.h>
+#include <limits.h>
#include <unistd.h>
#include "cgi.h"
@@ -46,7 +47,7 @@ download(struct kreq * r)
void *buffer;
struct stat st;
int st_ret, fd;
- char file_path[URL_LENGTH_MAX];
+ char file_path[PATH_MAX];
size_t path_size;
/* check that the requested URL can be safely processed */
@@ -54,11 +55,11 @@ download(struct kreq * r)
http_exit(r, KHTTP_400, "download: Invalid request path");
/* build requested file path */
- path_size = url_build(file_path, URL_LENGTH_MAX, DATA_DIR, "File.txt",
+ path_size = url_build(file_path, PATH_MAX, DATA_DIR, "File.txt",
NULL);
if (path_size == 0)
http_exit(r, KHTTP_404, "download: Unable to build file path");
- if (path_size >= URL_LENGTH_MAX)
+ if (path_size >= PATH_MAX)
http_exit(r, KHTTP_414, NULL);
/* memory map the file */