fix multibyte tag encoding

This commit is contained in:
leitner
2010-03-24 01:13:24 +00:00
parent a216b19483
commit e90320f819

View File

@@ -4,7 +4,7 @@
/* as used in ASN.1 tags */
size_t fmt_asn1tag(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,unsigned long l) {
/* encoding is either l%128 or (0x1f,...) */
size_t needed=(sizeof l)*7/8,i;
size_t needed=((sizeof l)*7)/8,i;
if (l<0x1f) {
if (dest) *dest=(int)tc+(int)tt+(l&0x1f);
return 1;