aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/routing.c6
-rw-r--r--src/server.c1
2 files changed, 2 insertions, 5 deletions
diff --git a/src/routing.c b/src/routing.c
index 1ae4ce9..55a6599 100644
--- a/src/routing.c
+++ b/src/routing.c
@@ -116,8 +116,7 @@ static int canonicalize_path(char *canonical, const char *path, size_t max_len)
static bool is_safe_path_component(const char *component) {
if (strstr(component, "..") ||
- strstr(component, "//") ||
- strchr(component, '\0') != component + strlen(component)) {
+ strstr(component, "//")) {
return false;
}
@@ -324,7 +323,6 @@ bool serve_static_file_with_mime(const char *request_path_relative_to_static, co
size_t bytes_read;
bool send_error = false;
- clearerr(fp);
while (!send_error && !feof(fp) && !ferror(fp) && (bytes_read = fread(file_buffer, 1, sizeof(file_buffer), fp)) > 0) {
if (send(current_client_socket, file_buffer, bytes_read, 0) < 0) {
perror("Error sending static file content");
@@ -390,4 +388,4 @@ bool serve_data(const char *data, size_t size, const char *mime_type) {
}
return true;
-} \ No newline at end of file
+}
diff --git a/src/server.c b/src/server.c
index 828bf26..9f1ca2a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -9,7 +9,6 @@
#include <sys/socket.h>
#include <unistd.h>
#include <pthread.h>
-#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>