From: Amos Jeffries Date: Fri, 20 Mar 2009 04:06:09 +0000 (+1300) Subject: Polish on Coverity fixes. X-Git-Tag: SQUID_3_2_0_1~1110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a0a5f63e6d8e7ea594f7aba5fcbdcef49491195b;p=thirdparty%2Fsquid.git Polish on Coverity fixes. Typo on array size remained. And IPAddress operator proved to be unneeded. Now killed completely. --- diff --git a/include/snmp_error.h b/include/snmp_error.h index 82a0a3dc3b..c3478110e8 100644 --- a/include/snmp_error.h +++ b/include/snmp_error.h @@ -44,6 +44,7 @@ #define SNMP_ERR_WRONGTYPE (0x7) #define SNMP_ERR_WRONGLENGTH (0x8) #define SNMP_ERR_WRONGENCODING (0x9) +/* 0x0A - 0x0F undefined */ #define SNMP_ERR_WRONGVALUE (0x10) #define SNMP_ERR_NOCREATION (0x11) #define SNMP_ERR_INCONSISTENTVALUE (0x12) diff --git a/snmplib/snmp_error.c b/snmplib/snmp_error.c index d2edea084b..a68d4dbfa0 100644 --- a/snmplib/snmp_error.c +++ b/snmplib/snmp_error.c @@ -33,7 +33,8 @@ #include "snmp_error.h" -static const char *error_string[19] = { +static const char *error_string[25] = { + /* 0x00 - 0x05 */ "No Error", "Response message would have been too large.", "There is no such variable name in this MIB.", @@ -41,19 +42,22 @@ static const char *error_string[19] = { "This variable is read only", "A general failure occured", + /* 0x06 - 0x09 */ /* SNMPv2 Errors */ "NOACCESS", "WRONGTYPE", "WRONGLENGTH", "WRONGENCODING", -/* 0xA */"UNDEFINED", -/* 0xb */"UNDEFINED", -/* 0xC */"UNDEFINED", -/* 0xD */"UNDEFINED", -/* 0xE */"UNDEFINED", -/* 0xF */"UNDEFINED", + /* 0x0A - 0x0F */ + "UNDEFINED", + "UNDEFINED", + "UNDEFINED", + "UNDEFINED", + "UNDEFINED", + "UNDEFINED", + /* 0x10 - 0x18 */ "WRONGVALUE", "NOCREATION", "INCONSISTENTVALUE", diff --git a/src/ip/IpAddress.cc b/src/ip/IpAddress.cc index 1fc77b1f55..90f15e6f56 100644 --- a/src/ip/IpAddress.cc +++ b/src/ip/IpAddress.cc @@ -649,13 +649,6 @@ IpAddress::IpAddress(IpAddress *s) operator=(s); } -IpAddress& IpAddress::operator =(IpAddress *s) -{ - if (!s) return *this; - IpAddress *tmp = static_cast(s); - return operator=(*tmp); -} - IpAddress::IpAddress(const struct hostent &s) { SetEmpty(); diff --git a/src/ip/IpAddress.h b/src/ip/IpAddress.h index 4c40ac2b2e..74aa0af285 100644 --- a/src/ip/IpAddress.h +++ b/src/ip/IpAddress.h @@ -133,7 +133,6 @@ public: /** @name Assignment Operators */ /*@{*/ IpAddress& operator =(const IpAddress &s); - IpAddress& operator =(IpAddress *s); IpAddress& operator =(struct sockaddr_in const &s); IpAddress& operator =(struct sockaddr_storage const &s); IpAddress& operator =(struct in_addr const &s);