From b076ca71dcd955e115127535b4f41ba68dd4ce44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 13 Aug 2021 22:25:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E5=86=85?= =?UTF-8?q?=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.c b/server.c index 56ad23b..3f9c279 100644 --- a/server.c +++ b/server.c @@ -121,10 +121,10 @@ static void accept_request(void *cli) { not_found(client); } else { int pathlen = strlen(path) + 1; - char path_heap[pathlen + 11]; // 11 is for possible /index.html - memcpy(path_heap, path, pathlen); + char path_stack[pathlen + 11]; // 11 is for possible /index.html + memcpy(path_stack, path, pathlen); printf("<%d> ", pathlen); - path = path_heap; + path = path_stack; int query_length = strlen(query_string) + 1; char query_string_stack[query_length];