diff --git a/fmt/fmt_asn1derlength.c b/fmt/fmt_asn1derlength.c index f4814d7..70da5e2 100644 --- a/fmt/fmt_asn1derlength.c +++ b/fmt/fmt_asn1derlength.c @@ -1,4 +1,5 @@ #include +#include static size_t asn1derlengthbytesneeded(unsigned long long l) { size_t needed; @@ -15,9 +16,7 @@ size_t fmt_asn1derlength(char* dest,unsigned long long l) { if (dest) *dest=l&0x7f; return 1; } - for (i=1; i>(i*8))) - break; + i=asn1derlengthbytesneeded(l); if (dest) { size_t j=i; *dest=(char)(0x80+i); ++dest;