Commit 08241a58 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Make i2c_ASN1_BIT_STRING return the correct length.
parent 3d27b1fa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -71,8 +71,6 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
	if (a == NULL) return(0);

	len=a->length;
	ret=1+len;
	if (pp == NULL) return(ret);

	if (len > 0)
		{
@@ -100,6 +98,10 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
		}
	else
		bits=0;

	ret=1+len;
	if (pp == NULL) return(ret);

	p= *pp;

	*(p++)=(unsigned char)bits;