From 1369b7429958a22a76754a28bc6c6743c62fa23d Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Fri, 5 Apr 2019 09:14:28 +0200 Subject: transfer: fix LGTM alert "Comparison is always true" Just remove the redundant condition, which also makes it clear that k->buf is always 0-terminated if this break is not hit. Closes https://github.com/curl/curl/pull/3732 --- lib/transfer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index ca6031724..0c6056a08 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -650,7 +650,7 @@ static CURLcode readwrite_data(struct Curl_easy *data, if(0 < nread || is_empty_data) { k->buf[nread] = 0; } - else if(0 >= nread) { + else { /* if we receive 0 or less here, the server closed the connection and we bail out from this! */ DEBUGF(infof(data, "nread <= 0, server closed connection, bailing\n")); -- cgit v1.2.3