polenter / SharpSerializer

SharpSerializer can serialize types like: multidimensional array, nested array, array-of-arrays, polymorphic object (where value is inherited from the property type), generic type, generic listing (i.e. dictionary, collection) and many more, with a single line of code
https://www.sharpserializer.net
Other
114 stars 28 forks source link

Invalid return for signed bytes in GetNumberSize #14

Open jtsylve opened 3 years ago

jtsylve commented 3 years ago

https://github.com/polenter/SharpSerializer/blob/55782864a46016c663779688b400026bcb354d4a/SharpSerializer/Core/Binary/Elements.cs#L226

This function returns an invalid number of bytes for signed 8-bit integers. I believe the check should be referencing SByte.MinValue and SByte.MaxValue rather than byte.