From 986c04ec2b6f685a771e02c4c945236ae5cf418d Mon Sep 17 00:00:00 2001 From: Saleh Ahmed Khan <s.khan20@student.unimelb.edu.au> Date: Sun, 15 Apr 2018 16:56:02 +1000 Subject: [PATCH] cleaned comments --- get.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/get.c b/get.c index 353a9f0..9ee9056 100644 --- a/get.c +++ b/get.c @@ -13,22 +13,15 @@ void valid_get(char* buffer) { // checks if the request is valid void parse(char* req, char* root) { // Extract just the file path from the request // message into the char array 'path'. - // printf("%s\n", req); const char* path_start = strchr(req, ' ') + 1; - // printf("%c start\n", *path_start); const char* path_end = strrchr(req, ' '); - // printf("%c final\n", *path_end); - // int path_len = path_start - path_end; char path[path_end - path_start]; strncpy(path, path_start, path_end - path_start); path[sizeof(path)] = '\0'; // null terminator // printf("root %s\n", root); - // printf("path %s\n", path); char full_path[sizeof(path) + sizeof(root)]; strcpy(full_path, root); strcat(full_path, path); - // full_path[sizeof(full_path)-1] = 9; - printf("waiittt %s end\n", full_path); find_file(full_path); } @@ -37,7 +30,8 @@ void find_file(char* path_to_file) { fp = fopen(path_to_file, "r"); if (fp != NULL) { - printf("success...\n");fclose(fp); + printf("success...\n"); + fclose(fp); } else { printf("fail\n"); } -- GitLab