From 0bb10768980eefd6f9d63a27fc38de67c370d6cd 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: Thu, 16 Mar 2023 00:54:27 +0800 Subject: [PATCH] fix: string compare issue --- server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.c b/server.c index 2d51dc7..870c10c 100644 --- a/server.c +++ b/server.c @@ -310,7 +310,7 @@ static int close_file_and_send(threadtimer_t *timer, char *data, size_t numbytes return send_data(timer->accept_fd, data, numbytes); } -#define take_word(p, w, buff) if((p)->numbytes >= strlen(w) && strncmp(buff, w, strlen(w)) == buff) {\ +#define take_word(p, w, buff) if((p)->numbytes >= strlen(w) && !strncmp(buff, w, strlen(w))) {\ printf("<--- Taking: %s in %zd --->\n", w, (p)->numbytes);\ int l = strlen(w);\ char store = buff[l];\