[haiku-commits] Change in haiku[master]: libnetapi: Fix if condition

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 25 Jun 2020 11:26:44 +0000

From Murai Takashi <tmurai01@xxxxxxxxx>:

Murai Takashi has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2950 ;)


Change subject: libnetapi: Fix if condition
......................................................................

libnetapi: Fix if condition

Fix length[0] != '+' could not be checked.
Pointed out by cppcheck.

Change-Id: Ic4697dc9ffd04afcd92ef3ed65485e1fe3f32e76
---
M src/kits/network/libnetapi/HttpResult.cpp
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/50/2950/1

diff --git a/src/kits/network/libnetapi/HttpResult.cpp 
b/src/kits/network/libnetapi/HttpResult.cpp
index aee7c34..41aa4fb 100644
--- a/src/kits/network/libnetapi/HttpResult.cpp
+++ b/src/kits/network/libnetapi/HttpResult.cpp
@@ -99,7 +99,7 @@
         *
         * We can check length[0] directly because header values are trimmed by
         * HttpHeader beforehand. */
-       if (length[0] != '-' || length[0] != '+') {
+       if (length[0] != '-' && length[0] != '+') {
                errno = 0;
                char *endptr = NULL;
                result = strtoul(length, &endptr, 10);

--
To view, visit https://review.haiku-os.org/c/haiku/+/2950
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Ic4697dc9ffd04afcd92ef3ed65485e1fe3f32e76
Gerrit-Change-Number: 2950
Gerrit-PatchSet: 1
Gerrit-Owner: Murai Takashi <tmurai01@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: libnetapi: Fix if condition - Gerrit