Fix some implicit truncation and sign coersion in the networking APIs
[folly.git] / folly / MacAddress.cpp
index 1ce5d1ec3615ace3fd22a7798bcafc31545e864e..3b8dabaa104b77d435398cb1d8d0929b8fb07c5c 100644 (file)
@@ -128,7 +128,7 @@ void MacAddress::parse(StringPiece str) {
     }
 
     // Update parsed with the newly parsed byte
-    parsed[byteIndex] = ((upper << 4) | lower);
+    parsed[byteIndex] = uint8_t((upper << 4) | lower);
   }
 
   if (p != str.end()) {