From 42beec472b4a43e07cd2e9fc0b5f703f12ed96b3 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 28 Sep 2014 11:49:09 -0700 Subject: [PATCH] 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. --- src/SBuf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] -- 2.47.2