From 0727b8f3a9ef34b7e92128d4ef1cab6665f25fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Thu, 20 Sep 2018 14:59:06 +0200 Subject: [PATCH 28/83] * src/http.c (resp_new): Fix code to avoid false positive by clang --- src/http.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/http.c b/src/http.c index 46fde6f2..e3f5639a 100644 --- a/src/http.c +++ b/src/http.c @@ -648,10 +648,13 @@ resp_new (char *head) { char *end = strchr (hdr, '\n'); - if (end) - hdr = end + 1; - else - hdr += strlen (hdr); + if (!end) + { + hdr += strlen (hdr); + break; + } + + hdr = end + 1; if (*hdr != ' ' && *hdr != '\t') break; -- 2.19.1