Fix int vs. ssize_t type confusion

Plus a typo in the target type of a static_cast.

Change-Id: Icb8288baeab20d470c334742d989ffe231fdca7c
diff --git a/src/encoding/tlv.hpp b/src/encoding/tlv.hpp
index 889d0b8..ad964e2 100644
--- a/src/encoding/tlv.hpp
+++ b/src/encoding/tlv.hpp
@@ -294,7 +294,7 @@
       return false;
     }
 
-  type = static_cast<uint64_t>(number);
+  type = static_cast<uint32_t>(number);
   return true;
 }