From dab82c806f35c671f87ea60087b19e3781b35a29 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Fri, 17 Sep 2021 00:34:02 +0200 Subject: do not shadow global redirect variable --- src/handler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/handler.c b/src/handler.c index 8e81c1f..5bcef6b 100644 --- a/src/handler.c +++ b/src/handler.c @@ -57,8 +57,8 @@ int tip_client_state_process_payload(struct tip_client *cli) const char *trailer, *x_redirect; bool allow_redirect = true; char _uri[32], *uri = _uri; + char allow_redirect_str[5]; char path[PATH_MAX + 1]; - char redirect[5]; struct stat st; int err; @@ -80,8 +80,8 @@ int tip_client_state_process_payload(struct tip_client *cli) x_redirect = strstr(cli->buf, "X-Accept-Redirect: "); if (x_redirect && - sscanf(x_redirect, "X-Accept-Redirect: %4s", redirect) == 1 && - !strncmp(redirect, "off", strlen("off"))) + sscanf(x_redirect, "X-Accept-Redirect: %4s", allow_redirect_str) == 1 && + !strncmp(allow_redirect_str, "off", strlen("off"))) allow_redirect = false; trailer = strstr(cli->buf, "\r\n\r\n"); -- cgit v1.2.3-18-g5258