finish refactor

This commit is contained in:
leitner
2025-04-25 21:40:45 +00:00
parent 3867c1d7d3
commit d3557b2b3a

View File

@@ -1,4 +1,5 @@
#include <libowfat/fmt.h>
#include <assert.h>
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<sizeof l; ++i)
if (!(l>>(i*8)))
break;
i=asn1derlengthbytesneeded(l);
if (dest) {
size_t j=i;
*dest=(char)(0x80+i); ++dest;