Skip to content

Commit 9a5afdf

Browse files
authored
Fix -Wlogical-not-parentheses warning (#79)
* Fix -Wlogical-not-parentheses warning The warning occurs because `operator!()` has higher precedence than `operator>()`. Alternatively, we can use: ``` iClient->connect(iServerAddress, iServerPort) <= 0 ```
1 parent 7f36561 commit 9a5afdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HttpClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod,
8484
{
8585
if (iServerName)
8686
{
87-
if (!iClient->connect(iServerName, iServerPort) > 0)
87+
if (!(iClient->connect(iServerName, iServerPort) > 0))
8888
{
8989
#ifdef LOGGING
9090
Serial.println("Connection failed");
@@ -94,7 +94,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod,
9494
}
9595
else
9696
{
97-
if (!iClient->connect(iServerAddress, iServerPort) > 0)
97+
if (!(iClient->connect(iServerAddress, iServerPort) > 0))
9898
{
9999
#ifdef LOGGING
100100
Serial.println("Connection failed");

0 commit comments

Comments
 (0)