From: Amos Jeffries Date: Sun, 28 Sep 2014 18:49:09 +0000 (-0700) Subject: Cleanup: use SBuf::npos instead of npos in SBuf::append() X-Git-Tag: SQUID_3_5_0_1~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42beec472b4a43e07cd2e9fc0b5f703f12ed96b3;p=thirdparty%2Fsquid.git Cleanup: use SBuf::npos instead of npos in SBuf::append() 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. --- diff --git a/src/SBuf.cc b/src/SBuf.cc index fb9e989505..1184894381 100644 --- a/src/SBuf.cc +++ b/src/SBuf.cc @@ -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]