Skip to content

Commit 32f9a66

Browse files
authored
Remvoed erroneous use of bit converter tochar in stun error attribute ctor. (#1235)
1 parent bbf0867 commit 32f9a66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/net/STUN/STUNAttributes/STUNErrorCodeAttribute.cs

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//-----------------------------------------------------------------------------
1+
//-----------------------------------------------------------------------------
22
// Filename: STUNErrorCodeAttribute.cs
33
//
44
// Description: Implements STUN error attribute as defined in RFC5389.
@@ -35,8 +35,8 @@ public int ErrorCode
3535
public STUNErrorCodeAttribute(byte[] attributeValue)
3636
: base(STUNAttributeTypesEnum.ErrorCode, attributeValue)
3737
{
38-
ErrorClass = (byte)BitConverter.ToChar(attributeValue, 2);
39-
ErrorNumber = (byte)BitConverter.ToChar(attributeValue, 3);
38+
ErrorClass = attributeValue[2];
39+
ErrorNumber = attributeValue[3];
4040
ReasonPhrase = Encoding.UTF8.GetString(attributeValue, 4, attributeValue.Length - 4);
4141
}
4242

0 commit comments

Comments
 (0)