]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: use SBuf::npos instead of npos in SBuf::append()
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Sep 2014 18:49:09 +0000 (11:49 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 28 Sep 2014 18:49:09 +0000 (11:49 -0700)
Small experiment. It is possible on some systems that std::npos / ::npos
is defined with a different integer size and value.
This may be what is confusing Coverity scan and producing buffer overrun
alerts in the append() c-string with default parameter case.

src/SBuf.cc

index fb9e989505f6b101c0bfa7bd6efa3b353296b0a0..11848943810936cc4723c6ec39974c1630552254 100644 (file)
@@ -210,7 +210,7 @@ SBuf::append(const char * S, size_type Ssize)
 {
     if (S == NULL)
         return *this;
-    if (Ssize == npos)
+    if (Ssize == SBuf::npos)
         Ssize = strlen(S);
     debugs(24, 7, "from c-string to id " << id);
     // coverity[access_dbuff_in_call]