Parcourir la source

[3833] Added a static_cast from size_t to uint16_t

Francis Dupont il y a 10 ans
Parent
commit
7fd750f6d0
2 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 2 2
      src/lib/dhcp/option.cc
  2. 1 1
      src/lib/dhcp/option_custom.cc

+ 2 - 2
src/lib/dhcp/option.cc

@@ -160,10 +160,10 @@ uint16_t Option::len() {
         length += (*it).second->len();
     }
 
-    // note that this is not equal to lenght field. This value denotes
+    // note that this is not equal to length field. This value denotes
     // number of bytes required to store this option. length option should
     // contain (len()-getHeaderLen()) value.
-    return (length);
+    return (static_cast<uint16_t>(length));
 }
 
 bool

+ 1 - 1
src/lib/dhcp/option_custom.cc

@@ -519,7 +519,7 @@ OptionCustom::len() {
         length += (*it).second->len();
     }
 
-    return (length);
+    return (static_cast<uint16_t>(length));
 }
 
 void OptionCustom::initialize(const OptionBufferConstIter first,