Browse Source

[3919] Assign typecode_ to avoid cppcheck warning

Francis Dupont 9 years ago
parent
commit
8939fad87d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/lib/dns/rrtype.cc

+ 3 - 1
src/lib/dns/rrtype.cc

@@ -32,10 +32,12 @@ namespace isc {
 namespace dns {
 namespace dns {
 
 
 RRType::RRType(const std::string& type_str) {
 RRType::RRType(const std::string& type_str) {
-    if (!RRParamRegistry::getRegistry().textToTypeCode(type_str, typecode_)) {
+    uint16_t typecode;
+    if (!RRParamRegistry::getRegistry().textToTypeCode(type_str, typecode)) {
         isc_throw(InvalidRRType,
         isc_throw(InvalidRRType,
                   "Unrecognized RR type string: " + type_str);
                   "Unrecognized RR type string: " + type_str);
     }
     }
+    typecode_ = typecode;
 }
 }
 
 
 RRType::RRType(InputBuffer& buffer) {
 RRType::RRType(InputBuffer& buffer) {