]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish on Coverity fixes.
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 20 Mar 2009 04:06:09 +0000 (17:06 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 20 Mar 2009 04:06:09 +0000 (17:06 +1300)
Typo on array size remained.

And IPAddress operator proved to be unneeded. Now killed completely.

include/snmp_error.h
snmplib/snmp_error.c
src/ip/IpAddress.cc
src/ip/IpAddress.h

index 82a0a3dc3b37556e44d4537e860289d2356512c8..c3478110e888147c286079ba20c06eb80217006b 100644 (file)
@@ -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)
index d2edea084b17bbc61ccd87e7671a044e4be8f9d5..a68d4dbfa02d1b48f402147f601af5cb824cf1a5 100644 (file)
@@ -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",
index 1fc77b1f55ef44a7b6b85de9f93f3bfcc081ffcd..90f15e6f56294436f4799b451c652c47adaa4d3c 100644 (file)
@@ -649,13 +649,6 @@ IpAddress::IpAddress(IpAddress *s)
     operator=(s);
 }
 
-IpAddress& IpAddress::operator =(IpAddress *s)
-{
-    if (!s) return *this;
-    IpAddress *tmp = static_cast<IpAddress*>(s);
-    return operator=(*tmp);
-}
-
 IpAddress::IpAddress(const struct hostent &s)
 {
     SetEmpty();
index 4c40ac2b2e1830f09e2a1894a74b876c83ce1c4f..74aa0af2850f5d415321854d9c133e640cc1362d 100644 (file)
@@ -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);